2011-03-02 112 views
6

1.從OpenSSL(openssl-1.0.0d)下載源代碼。QT使用OpenSSL構建時出錯

2.Build其靜態使用此:

> 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-比比皆是 - 開源-SRC-4.7.1,

修補它(QTDIR \ mkspecs \ Win32的msvc2010 \ QMAKE .conf文件 -/MD到/ MT和/ MDD到/ MTD)

複製斌/ lib中/

,並試圖構建它使用next * .BAT包括了OpenSSL文件夾QTDIR斌/ lib目錄/文件夾,包括

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 

期間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 [email protected] referenced in function _readscreen 
libeay32.lib(rand_win.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function _readscreen 
libeay32.lib(rand_win.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function _readscreen 
libeay32.lib(rand_win.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function _readscreen 
libeay32.lib(rand_win.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function _readscreen 
libeay32.lib(rand_win.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function _readscreen 
libeay32.lib(rand_win.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function _readscreen 
libeay32.lib(rand_win.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function _readscreen 
libeay32.lib(rand_win.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function _readscreen 
libeay32.lib(rand_win.obj) : error LNK2019: unresolved external symbol [email protected] 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. 

任何幫助,得到錯誤? Here說我可以通過將Gdi32.lib添加到您的庫列表中來修復它。怎麼做?

+0

如果您已經安裝了Visual Studio中,我想使用VS命令提示符將解決這一點。反正我沒有問題。 – 2012-09-19 23:16:35

回答

7

當您運行configure時,您必須添加-L "path/to/dir/with/Gdi32library/"-l Gdi32 params。

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

+0

謝謝,問題解決了 – DmitryM 2011-03-02 09:07:09

+0

非常感謝你:) – 2013-03-09 12:36:08