I´m trying to compile a very simple proyect in Qt with OpenSSL, but it always show me a linker error, however works fine when I compile in Visual C++ 2010.
Code:
#include <openssl\sha.h>
int main(int argc, char *argv[]){
unsigned char in[] = "Hola";
unsigned char out[33] = {0};
SHA256(in,4,out);
return 0;
}
Error:
main.obj:-1: error: LNK2019: símbolo externo _SHA256 sin resolver al que se hace referencia en la función _main
I have installed:
- Qt 5.1.1 for Windows 32-bit (VS 2010, 505 MB)
- OpenSSL-Win32 from a binary file (Win32 OpenSSL v1.0.1e, 16MB)
- Microsoft Visual C++ 2010 (Express Edidition)
The .pro file from Qt is:
#-------------------------------------------------
#
# Project created by QtCreator 2013-11-29T23:21:36
#
#-------------------------------------------------
QT += core
QT -= gui
TARGET = prueba_openssl
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
INCLUDEPATH += C:/OpenSSL-Win32/include
LIBS += -L"C:/OpenSSL-Win32/lib" -llibeay32
Any suggestions?
Thank you!