undefined reference to symbol even when nm indicates that this symbol is present in the shared library

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.

Leave a Comment