Libraries must be listed after the objects that use them (more precisely, a library will be used only if it contains a symbol that satisfies an undefined reference known at the time it is encountered). Move the -lmnl
to the end of the command.
More Related Contents:
- ld cannot find an existing library
- How can I link to a specific glibc version?
- How to print the ld(linker) search path
- “/usr/bin/ld: cannot find -lz”
- Compilation fails with “relocation R_X86_64_32 against `.rodata.str1.8′ can not be used when making a shared object”
- How to specify the library version to use at link time?
- What is the ‘soname’ option for building shared libraries for?
- Hierarchical ldd(1)
- How do you link to a specific version of a shared library in GCC
- How to include all objects of an archive in a shared object?
- Is there a way to get gcc to output raw binary?
- How can I change the filename of a shared library after building a program that depends on it?
- How to set RPATH and RUNPATH with GCC/LD?
- How do the likely/unlikely macros in the Linux kernel work and what is their benefit?
- Linux error while loading shared libraries: cannot open shared object file: No such file or directory
- how to install gcc 4.9.2 on RHEL 7.4
- How do I set the working directory of the parent process?
- Calling printf in x86_64 using GNU assembler
- Linking OpenSSL libraries to a program
- Can I change ‘rpath’ in an already compiled binary?
- How do I view the list of functions a Linux shared library is exporting?
- Linking a shared library with another shared lib in linux
- What’s the difference between “statically linked” and “not a dynamic executable” from Linux ldd?
- Build .so file from .c file using gcc command line
- Linking error: DSO missing from command line
- How to avoid STT_GNU_IFUNC symbols in your binary?
- What’s the difference between .so, .la and .a library files?
- How can a shared library (.so) call a function that is implemented in its loader code?
- What does exactly the warning mean about hidden symbol being referenced by DSO?
- /usr/bin/ld: skipping incompatible foo.so when searching for foo