Why am I getting “undefined reference to `dladdr'” even with -ldl for this simple program?

The library requiring the symbols is included by -lLLVMSupport, so -ldl must come after -lLLVMSupport. I changed this:

`llvm-config --ldflags --libs core`

To this:

`llvm-config --libs core` `llvm-config --ldflags`

And the linker was successful.

Leave a Comment