开发者

Ubuntu Deployment Problem for a C++ Project

I am trying to deploy my application from development environment to users' computer, but I have some issues.

First, I compile and run it on my development computer (higher version Ubuntu11.04):

Ubuntu11.04$ make
Ubuntu11.04$ ./MyApp
Program runs okay.

Then I copied the binaries MyApp to two lower-version machines (users' computer):

Ubuntu10.04$ ./MyApp
/usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.14' not found (required by ./MyApp)

Ubuntu8.04$ ./MyApp
/usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by ./MyApp)
/usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.14' not found (required by ./MyApp)

However, if I compile the source code on Ubuntu10.04, and run it:

Ubuntu10.04$ make
Ubuntu10.04$ ./MyApp
Program runs okay.

What should I do with this? When I compile it in development environment, how can I set the version number of the used library? I'm开发者_运维知识库 not directly using GLIBCXX, I think it's being used implicitly somewhere in my project.

Thx a million.

Peter


Did you see Link with an older version of libstdc++

I have never installed an older version of g++, but I have included a libstdc++.so in my release and that has worked for me. Best solution I have seen is get your development stuff to work on the oldest possible system. We compile some stuff on Red Hat 9 and it work on everything, but it can be any major issue building on old machines as you say.


You have built on version N, and tried to deploy on version M, M<N. You will need to get the deployment computer upgraded, or learn the procedure to compile and link targeting an older version. Since the problem lives in libstdc++, I'm afraid that my advice is to downgrade your entire dev system or upgrade the target, libstdc++ is not easy to deal with. Another answer here has someone's recipe.

Keep in mind that the Ubuntu/Debian community is optimized for open source. From their point of view, the solution to this is for you to distribute source code with the auto* tools, and let the user built it for him or her-self. They don't stay up late making this easy for you.

Here in the evil world of closed source, we keep around VMs running all sorts of old linux distros just so that we can build a single binary that runs in many places.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜