g++ and libstdc are coupled

g++ and libstdc are coupled. A specific version of g++ uses a specific version of libstdc. It can not be changed. 

 

Recently, I am building a program on ubuntu 9.10 which has g++4 installed. When I run make, the following text shows up.

 

if [ ! -d ./../linux ]; then (umask 002; set -x; mkdir ./../linux ); fi
g++ -m32 -c   -I../../../../include -o ./../linux/testxd.o ./../testxd.cpp
g++ -m32 -ldl  -o ./../linux/testxdApp -L../../../lib/linux -lspssxd -lpthread ./../linux/testxd.o
/usr/bin/ld: warning: libstdc++.so.5, needed by ../../../lib/linux/libspssxd.so, may conflict with libstdc++.so.6

 

The reasion is that libspssxd.so is built with libstdc++5. But libstdc++6 is used for building of my program since g++4 use libstdc++6. This kind of warnings should never be ignored. Otherwise, it can cause you a big headache. For my case, some program built with this warning works well. But some exit with invalid pointer error.

 

ABI Policy and Guideline gives a detailed descritpion of the relationship between g++ and libstdc.

Program Library HOWTO is a good explanation of libraries on linux platform.

你可能感兴趣的:(C++,c,linux,ubuntu,UP)