I'm ussing QSslKey to obtain Private Key of a .key file, but when compiling, I'm getting the above error. The problem is with the QSslKey instruction.
Where is part of my code:
QFile file(PRIVATEKEY_FILE
);
if (!file.isOpen()) {
qWarning("No se puede abrir %s", PRIVATEKEY_FILE);
return;
}
QSslKey key(&file, QSsl::Rsa, QSsl::Der, QSsl::PrivateKey, "a012345679");
if (key.isNull()) {
qWarning("No se pudo obtener la llave privada");
return;
}
QFile file(PRIVATEKEY_FILE);
file.open(QIODevice::ReadOnly);
if (!file.isOpen()) {
qWarning("No se puede abrir %s", PRIVATEKEY_FILE);
return;
}
QSslKey key(&file, QSsl::Rsa, QSsl::Der, QSsl::PrivateKey, "a012345679");
if (key.isNull()) {
qWarning("No se pudo obtener la llave privada");
return;
}
To copy to clipboard, switch view to plain text mode
Here is the compile output:
Running build steps for project MD5...
Configuration unchanged, skipping qmake step.
Starting: "C:/Qt/2010.05/mingw/bin/mingw32-make.exe" -w
mingw32-make: Entering directory `C:/Programas C++ Builder/QT_eFact/eFact/MD5-build-desktop'
C:/Qt/2010.05/mingw/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Programas C++ Builder/QT_eFact/eFact/MD5-build-desktop'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\..\Qt\2010.05\qt\include\QtCore" -I"..\..\..\..\Qt\2010.05\qt\include\QtGui" -I"..\..\..\..\Qt\2010.05\qt\include" -I"..\..\..\..\OpenSSL-Win32\include" -I"..\..\..\..\Qt\2010.05\qt\include\QtNetwork" -I"..\..\..\..\Qt\2010.05\qt\include\ActiveQt" -I"debug" -I"." -I"..\MD5" -I"." -I"..\..\..\..\Qt\2010.05\qt\mkspecs\win32-g++" -o debug\mainwindow.o ..\MD5\mainwindow.cpp
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\MD5.exe debug/main.o debug/mainwindow.o debug/moc_mainwindow.o -L"c:\Qt\2010.05\qt\lib" -lmingw32 -lqtmaind C:/OpenSSL-Win32/lib/libeay32.lib C:/OpenSSL-Win32/lib/ssleay32.lib -lQtGuid4 -lQtCored4
mingw32-make[1]: Leaving directory `C:/Programas C++ Builder/QT_eFact/eFact/MD5-build-desktop'
mingw32-make: Leaving directory `C:/Programas C++ Builder/QT_eFact/eFact/MD5-build-desktop'
debug/mainwindow.o:C:\Programas C++ Builder\QT_eFact\eFact\MD5-build-desktop/../MD5/mainwindow.cpp:188: undefined reference to `_imp___ZN7QSslKeyC1EP9QIODeviceN4QSsl12KeyAlgorit hmENS2_14EncodingFormatENS2_7KeyTypeERK10QByteArra y'
debug/mainwindow.o:C:\Programas C++ Builder\QT_eFact\eFact\MD5-build-desktop/../MD5/mainwindow.cpp:190: undefined reference to `_imp___ZNK7QSslKey6isNullEv'
debug/mainwindow.o:C:\Programas C++ Builder\QT_eFact\eFact\MD5-build-desktop/../MD5/mainwindow.cpp:193: undefined reference to `_imp___ZN7QSslKeyD1Ev'
debug/mainwindow.o:C:\Programas C++ Builder\QT_eFact\eFact\MD5-build-desktop/../MD5/mainwindow.cpp:193: undefined reference to `_imp___ZN7QSslKeyD1Ev'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\MD5.exe] Error 1
mingw32-make: *** [debug] Error 2
The process "C:/Qt/2010.05/mingw/bin/mingw32-make.exe" exited with code %2.
Error while building project MD5 (target: Desktop)
When executing build step 'Make'
Bookmarks