In my Qt program I have to convert a string to a hash. I want to use OpenSSL on Debian. Little brief of my code:
#include <openssl/sha.h>
...
unsigned char data[] = "data to hash";
unsigned char hash[SHA512_DIGEST_LENGTH];
SHA512(data, sizeof(data) - 1, hash);
I have installed openssl and libssl-dev. And I also have changed my .pro document, looks like that:
TEMPLATE = app
QT = core gui
HEADERS += window.h
PKGCONFIG += openssl //found in another solution, but it does not work
LIBS += -L/usr/share/doc libssl-dev
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
SOURCES += main.cpp window.cpp
In LIBS I have tried all possible locations that I get with sudo dpkg -L libssl-dev
. Does anyone what I am missing? It doesn't compile and I sure is about that.
Thanks.
Here is the error when linking:
/usr/lib/x86_64-linux-gnu/qt4/bin/qmake -o Makefile App.pro
g++ -m64 -Wl,-O1 -o App main.o window.o moc_window.o -L/usr/lib/x86_64-linux-gnu -L/usr/share/doc/libssl-dev -libssl-dev -lQtGui -lQtCore -lpthread
/usr/bin/ld: cannot find -libssl-dev
collect2: error: ld returned 1 exit status
Makefile:105: recipe for target 'App' failed
make: *** [App] Error 1