Linking libstdc++ statically: any gotchas?

后端 未结 5 1241
北恋
北恋 2020-11-27 09:16

I need to deploy a C++ application built on Ubuntu 12.10 with GCC 4.7\'s libstdc++ to systems running Ubuntu 10.04, which comes with a considerably older version of libstdc+

5条回答
  •  天涯浪人
    2020-11-27 10:09

    You might also need to make sure that you don't depend on the dynamic glibc. Run ldd on your resulting executable and note any dynamic dependencies (libc/libm/libpthread are usal suspects).

    Additional exercise would be building a bunch of involved C++11 examples using this methodology and actually trying the resulting binaries on a real 10.04 system. In most cases, unless you do something weird with dynamic loading, you'll know right away whether the program works or it crashes.

提交回复
热议问题