I downloaded the Crypto++ source and compiled the cryptlib project in Visual Studio 2013, and then I added the generated .lib file to my Qt project, which made my .pro file look like this:
QT += core gui
QT += sql
greaterThan(QT_MAJOR_VERSION, 4):QT += widgets
TARGET = untitled
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h \
databasecontrol.h \
test.h
FORMS += mainwindow.ui
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/ -lcryptlib
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/ -lcryptlibd
else:unix: LIBS += -L$$PWD/ -lcryptlib
INCLUDEPATH += $$PWD/
DEPENDPATH += $$PWD/
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/libcryptlib.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/libcryptlibd.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/cryptlib.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/cryptlibd.lib
else:unix: PRE_TARGETDEPS += $$PWD/libcryptlib.a
Immediately after adding this library to the project, I build it and get the following error:
:-1: error: No rule to make target 'C:/Users/Special Services/WorkOrder/libcryptlibd.a', needed by 'debug\untitled.exe'. Stop.
I believe I understand that the error is telling me that I need an additional line where all of the else:win32
lines are under DEPENDPATH
... or is it because the lines that were added use $$PWD
, isn't that a Unix command? I've looked around at other instances of this error and I'm fairly certain the problem is with something in the .pro file here.
EDIT:
I decided to take a different approach. I got rid of anything that importing a library added to my .pro file, and instead just put this line of code in its place:
win32:LIBS += C:\Qt\5.2.1\mingw48_32\include\cryptopp\Win32\Output\Debug\cryptlib.lib
(The path to the cryptlib.lib file)
This built just fine. I made sure that all of the cryptopp header files were in my include directory, C:\Qt\5.2.1\mingw48_32\include\cryptopp
I then tried to include a file, with #include <cryptopp/aes.h>
and it built fine. The first time I built, there were 40+ warnings, but the second time I built, it built without any.