Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
[SOLVED] Library inclusion problem
Clint Westwood last edited by Clint Westwood
I'm using winpcap library in my project. The folder of this library resides inside my project folder (where my .pro file is). It works fine if I include this library in .pro file by writing full path like this:
LIBS += "C:/.../.../.../.../.../My_project/WpdPack/Lib/wpcap.lib"
However, I'm constantly going between several different machines. This forces me to edit path in .pro file each time I arrive to another PC. This is inconvenient, so I'd like to make it so qmake automatically searches for my libraries inside my project folder. All my attempts to do so have failed so far.
I've tried this:
LIBS += -L/My_project/WpdPack/Lib/ -lwpcap \
but I get LNK1104 error in Windows compiler, telling me it can't open 'wpcap.lib'.
I've also tried this and it failed with same error:
INCLUDEPATH += $$PWD \ some_folder \ another_folder \ WpdPack/Include \ WpdPack/Lib LIBS += -lwpcap -lPacket
You should use $$PWD not just $PWD
LIBS += -L$$PWD/WpdPack/lib
Clint Westwood last edited by
Thanks, it worked.
You're welcome !
Since it's working now, please mark the thread as solved so other forum users may know a solution has been found :)