Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error during QT Build with OpenSSL

Tags:

c++

ssl

openssl

qt

qt4

1.Download source from OpenSSL (openssl-1.0.0d).

2.Build it static using this:

> perl Configure VC-WIN32 no-asm --prefix=d:\Miatar\cpplibs\openssl
> ms\do_ms
> nmake -f ms\nt.mak
> nmake -f ms\nt.mak install

3.Download qt-everywhere-opensource-src-4.7.1,

patching it (QTDIR\mkspecs\win32-msvc2010\qmake.conf - /MD to /MT and /MDd to /MTd)

copying bin / lib / include folders of openssl to QTDIR bin / lib / include folders

and trying to build it using next *.bat

setlocal
set MAKEFLAGS= 
call "D:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
set QMAKESPEC=win32-msvc2010
set PATH=%CD%\bin;%PATH%
configure -debug-and-release -platform win32-msvc2010 -static -no-crt -no-qt3support -nomake examples -nomake demos -openssl-linked -I "d:\Miatar\cpplibs\openssl\include" -L "d:\Miatar\cpplibs\openssl\lib"
nmake
pause
endlocal

getting error during nmake

Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

        "D:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe" -f Makefile.Debug all

Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

        cl -c -nologo -Zm200 -Zc:wchar_t- -Zi -MTd -MP -GR -EHsc -W3 -w34100 -w3 4189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_XMLPATTERNS_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"..\..\include\QtCore" -I"..\..\include\QtXmlPatterns" -I"..\..\include" -I"d:\Miatar\cpplibs\openssl\include" -I"..\..\include\ActiveQt" -I"tmp\moc\debug_static" -I"..\..\mkspecs\win32-msvc2010" -Fotmp\obj\debug_static\ @C:\Users\Daminian\AppData\Local\Temp\nm3A5A.tmp
main.cpp
qapplicationargument.cpp
qapplicationargumentparser.cpp
        link /LIBPATH:"d:\Miatar\cpplibs\QtStaticSSL\lib" /LIBPATH:"d:\Miatar\cpplibs\QtStaticSSL\lib" /NOLOGO /DELAYLOAD:"OleAcc.dll" /DEBUG /SUBSYSTEM:CONSOLE /MANIFEST /MANIFESTFILE:"tmp\obj\debug_static\xmlpatterns.intermediate.manifest" /OUT:..\..\bin\xmlpatterns.exe @C:\Users\Daminian\AppData\Local\Temp\nm416C.tmp
LINK : 
libeay32.lib(rand_win.obj) : error LNK2019: unresolved external symbol __imp__DeleteDC@4 referenced in function _readscreen
libeay32.lib(rand_win.obj) : error LNK2019: unresolved external symbol __imp__DeleteObject@4 referenced in function _readscreen
libeay32.lib(rand_win.obj) : error LNK2019: unresolved external symbol __imp__GetBitmapBits@12 referenced in function _readscreen
libeay32.lib(rand_win.obj) : error LNK2019: unresolved external symbol __imp__BitBlt@36 referenced in function _readscreen
libeay32.lib(rand_win.obj) : error LNK2019: unresolved external symbol __imp__GetObjectA@12 referenced in function _readscreen
libeay32.lib(rand_win.obj) : error LNK2019: unresolved external symbol __imp__SelectObject@8 referenced in function _readscreen
libeay32.lib(rand_win.obj) : error LNK2019: unresolved external symbol __imp__CreateCompatibleBitmap@12 referenced in function _readscreen
libeay32.lib(rand_win.obj) : error LNK2019: unresolved external symbol __imp__GetDeviceCaps@8 referenced in function _readscreen
libeay32.lib(rand_win.obj) : error LNK2019: unresolved external symbol __imp__CreateCompatibleDC@4 referenced in function _readscreen
libeay32.lib(rand_win.obj) : error LNK2019: unresolved external symbol __imp__CreateDCA@16 referenced in function _readscreen
..\..\bin\xmlpatterns.exe : fatal error LNK1120: 10 unresolved externals
NMAKE : fatal error U1077: '"D:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\link.EXE"' : return code '0x460'
Stop.
NMAKE : fatal error U1077: '"D:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.

any help? Here says that i can fix it by adding Gdi32.lib to your list of libraries. How to do that?

like image 452
DmitryM Avatar asked Mar 02 '11 07:03

DmitryM


1 Answers

You have to add -L "path/to/dir/with/Gdi32library/" and -l Gdi32 params when you run configure.

Example: configure -L "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1A/Lib/" -l Gdi32

like image 113
Piotr Dobrogost Avatar answered Oct 19 '22 03:10

Piotr Dobrogost