I'm trying to compile a C++ program in Linux Mint 17 using Qt 5.3.0. I have added the following line into .pro file:
QMAKE_LFLAGS += -ldl -fPIC
My program uses dlsym, but the linker cannot find it. Here's the error message:
undefined reference to symbol 'dlsym@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
How can I link my program?
I suggest to use the LIBS
variable for this rather than the QMAKE_LFLAGS
as follows:
LIBS += -ldl -fPIC
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With