[CMake] Undefined reference

Dan Kegel dank at kegel.com
Thu Nov 3 17:18:34 EDT 2011


On Thu, Nov 3, 2011 at 7:51 AM, Mauricio Klein
<mauricio.klein.msk at gmail.com> wrote:
> One last question: i've tried to compile my code using static linkage, once
> i need my daemon runs in many Linux releases.

Static linking of glibc is not really supported; IIRC glibc's
DNS and localization support use shared libraries under
the hood, even when you ask for static linking... and
since these are internal interfaces, they have changed
in incompatible ways in the past.  So beware!
While it may be ok to link statically to most libraries,
glibc should always be linked dynamically.

If you are still having problems after going back to
dynamically linking with glibc, please post source code
for a tiny test program that exhibits the problem, along
with how you built and tested it, and the log showing the
failure.
- Dan


More information about the CMake mailing list