Hi,
I’m trying to link a third party cryptographic library “Crypto++ 5.6.2” with my QT project however I keep getting the following error
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Here’s my .pro file:
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
SOURCES += main.cpp
INCLUDEPATH += /usr/include/
INCLUDEPATH += /usr/include/cryptopp/
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../usr/lib/release/ -lcryptopp
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../usr/lib/debug/ -lcryptopp
else:unix: LIBS += -L$$PWD/../../../../usr/lib/ -ldl -lpthread
INCLUDEPATH += $$PWD/../../../../usr/include
DEPENDPATH += $$PWD/../../../../usr/include
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../../../usr/lib/release/libcryptopp.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../../../usr/lib/debug/libcryptopp.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../../../usr/lib/release/cryptopp.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../../../usr/lib/debug/cryptopp.lib
else:unix: PRE_TARGETDEPS += $$PWD/../../../../usr/lib/libcryptopp.a
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../usr/lib/release/ -lsqlite3
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../usr/lib/debug/ -lsqlite3
else:unix: LIBS += -L$$PWD/../../../../usr/lib/ -lsqlite3
INCLUDEPATH += $$PWD/../../../../usr/include
DEPENDPATH += $$PWD/../../../../usr/include
OTHER_FILES += \
../../../../usr/lib/libcryptopp.a
I know I must add the “-lcryptopp” flag to the LIBS variable like so
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../usr/lib/release/ -lcryptopp
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../usr/lib/debug/ -lcryptopp
else:unix: LIBS += -L$$PWD/../../../../usr/lib/ -lcryptopp -ldl -lpthread
However when I do I get the following error message:
/Applications/Xcode.app/Contents/Developer/usr/bin/g++ -headerpad_max_install_names -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.6 -o testDaemon_CLI1 main.o -L/Users/omar/Projects/testDaemon_CLI1/../../../../usr/lib/ -ldl -lpthread -lsqlite3 -lcryptopp
ld: library not found for -lcryptopp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [testDaemon_CLI1] Error 1
I compiled a version of my project on the command-line with no problems using the same libraries, but for some reason QT seems to be having a problem with it, can anyone help?
Thanks!
↧