Undefined Linker References to dlopen or dlsym
Symptoms
When linking your application program on Linux OS, you see linker (
ld
) messages such as:
- undefined reference to `dlopen'
- undefined reference to `dlsym'
Cause
Intel® Advisor
#include
(C/C++) line to include the
Intel Advisor
-ldl
to enable dynamic loading.
Possible Solution
- Do the following:
- Add the linker option-ldlto your command line, script, or make file.
- Review the options listed in the Build Your Target Application to ensure that you specified all required compiler and linker options (use the link below under See Also). If omitted, add missing options to your command line, script, or make file.
- Rebuild your program.