PDA

View Full Version : how to solve the ld error: library not found for -lqwt ?



josentop
29th December 2011, 14:50
I'm try to port my Qt/Qwt application from linux to Mac platform, I have compiled the Qwt with Qt4 on Mac platform and install it into $(HOME)/QtSDK/Desktop/Qt/474/gcc/lib and then compile my application, it can pass the compile but failed on ld, tell me ':-1: error:library not found for -lqwt', could you please give me some suggestion? thanks.

stampede
29th December 2011, 16:07
You need to make sure that path where the qwt library file is located, is included with LIBS += -L/path/to/qwt/lib in .pro file. Also make sure that the library file name matches the linker settings (LIBS += -lqwt) in .pro file.

josentop
30th December 2011, 00:28
i have fixed the issue by change the -lqwt to -fqwt, but there is another error pop up,
Undefined symbols for architecture x86_64:
"QwtSamplingThread::QwtSamplingThread(QObject*)", referenced from:
SamplingThread::SamplingThread(QObject*)in samplingthread.o
SamplingThread::SamplingThread(QObject*)in samplingthread.o

Spitfire
4th January 2012, 14:06
I don't think you've fixed anything using -f flag.

-f
--auxiliary name
When creating an ELF shared object, set the internal DT_AUXILIARY
field to the specified name. This tells the dynamic linker that
the symbol table of the shared object should be used as an auxil-
iary filter on the symbol table of the shared object name.

Go back to using -l and fix the path as it's obviously wrong.

Use absolute paths if you don't know how to use qmake variables.
Start a console, go to directory where you have the qwt library, use 'pwd' to get full path and use that path.