HELP! Need to run cryptopp from Qt Creator
Hello,
I have cryptopp 5.3.0 and try to run it from Qt Creator 2.1.0 (Qt 4.7.2).
I have cryptopp.dll and cryptopp.lib downloaded from Crypto++ site.
Any attempt to run any code from cryptopp library results in LINKER error (LNK2001).
I will appreciate any help (like example or hint or link).
The .pro file is:
Code:
#-------------------------------------------------
#
# Project created by QtCreator 2011-08-11T15:29:52
#
#-------------------------------------------------
QT += core
QT -= gui
TARGET = Testik
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
LIBS += -Lcryptopp
And my main.cpp (there is no more files):
Code:
#include <iostream>
#define CRYPTOPP_DEFAULT_NO_DLL
#include <cryptopp/dll.h>
#ifdef CRYPTOPP_WIN32_AVAILABLE
#include <windows.h>
#endif
#include <cryptopp/md5.h>
int main(int argc, char *argv[])
{
byte digest[ CryptoPP::MD5::DIGESTSIZE ];
CryptoPP::HexEncoder encoder;
return 0;
}
Re: HELP! Need to run cryptopp from Qt Creator
Your LIBS setting is incorrect. Try:
Code:
LIBS += -L/path/to/CryptoPP/lib_dir -lcryptopp
(lib_dir contains cryptopp.lib)
You are possibly also missing an INCLUDEPATH, but if you get through compilation without it then the CryptoPP headers must be in a default location.
Re: HELP! Need to run cryptopp from Qt Creator
Hello I too am having problems including cryptopp in qt creator...I have an include path and the path set just like you described chris. I try different methods and I get linker errors, debug/exe errors, cannot find cryptopp.h...don't know what debug/exe error is.
this is my current include
Code:
INCLUDEPATH += <C:\Users\myname\Documents\cryptoProject\cryptopp>
LIBS += -L/path/to/CryptoPP/lib_dir -lcryptopp
The funny thing is when i hover over the includes in my mainwindow.cpp it shows the crypto includes directory...
Re: HELP! Need to run cryptopp from Qt Creator
Line 1: "<C:\Users\myname\Documents\cryptoProject\cryptopp >" is not a file path. Lose the "<" and ">" and switch all the "\" to "/". If the path contains spaces then you need to enclose it in quotes or move the library to somewhere without spaces in the path.
Line 2: You are supposed to replace "/path/to/CryptoPP/lib_dir" with the actual path you the directory containing the Crypto++ library