Build and run C++ code on different version of Linux and glibc

你离开我真会死。 提交于 2019-12-13 04:09:13

问题


Before asking the question I want to clarify that I am an Android developer with no experience of Linux and C/C++ programming. The only way I know to build a C project on Linux is through Eclipse but given a pointer or details on doing it other way I will not hesitate. So something in the question below might look awkward.

I have an issue where I compiled a cpp project and made executable on Ubuntu 12.04 using Eclipse Indigo. It runs fine here. Now I have to use the same executable on a RH server where I get the error: lib64/libc.so.6: version `GLIBC_2.14' not found

I searched internet and using command ldd --version found that glibc version on my dev machine is 2.15 and on server is 2.12. Also the gcc version on my machine is 4.6.3 and on server is 4.4.6.

How can I make it run on server? I went thought of installing other version of glibc on my machine and build it with reference to this question: Multiple glibc libraries on a single host. But I do not understand what is going on here.

I can think of 2 ways of doing this either build the project such that the executable includes all the needed files with it or build it in a way that it runs on older version of library.

Please try to provide as much details to answer or at least a pointer to understand it, given my inexperience on the platform.


回答1:


I copied my project files on the RH server and built the project there itself. Working fine..



来源:https://stackoverflow.com/questions/14452172/build-and-run-c-code-on-different-version-of-linux-and-glibc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!