I\'m trying to build a program against wxWidgets, and I get a linker error. I\'d like to really understand what it means. The error is:
/usr/lib/libwx_baseu-2.8.
When you link a shared library against other shared libraries (e.g. link libwx_baseu-2.8.so
against libstdc++.so
), the linker records versioned symbols used by libwx_baseu
and provided by libstdc++
.
If at runtime you use a different copy of libstdc++
(one which doesn't provide the same versioned symbol(s)), you get a (dynamic) liking error and the program doesn't run at all (this is preferable to a "mystery" crash later on).
But what's happening here is that you try to link an executable, which means the (static) linker wants to find all symbols which will be required at runtime. Again, you are linking the executable against a different (older) libstdc++.so
, and so the linking fails.
There are two usual root causes:
- either you linked libwx_baseu-2.8.so
on a different system (one with newer version of GCC), and copied it to the current system, or
- you've linked libwx_baseu-2.8.so
with a newer GCC on the same system, but now are trying to link the executable with an older GCC.