静态编译Qt 4.6.2 [英] Statically Compiling Qt 4.6.2

查看:753
本文介绍了静态编译Qt 4.6.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我做的,但它导致错误:



1:在win32-msvc2008\qmake.conf中设置 QMAKE_CFLAGS_RELEASE = O1 -Og -GL -MD



2:从MSVC2008 CMD我运行 vcvarsall.bat x86 vcvars32.batC:\Program Files \ Microsoft Visual Studio 9.0 \VC\bin



3:从Qt 4.6.2 CMD我运行以下


C:\Qt\4.6.2> configure -release
-nomake示例-nomake demos -no-exceptions -n o-stl -no-rtti -no-qt3support -no-scripttools -no-openssl -no-opengl -no-webkit
- no-phonon -no-style-motif -no-style-cde -no-style-cleanlooks -no-style-plastique
-no-sql-sqlite -platform win32-msvc2008 -static -qt-libjpeg
-qt-zlib -qt-libpng


,然后 nmake



但是,我每次都遇到这些错误:


  link /LIBPATH:\"c:\Qt\4.6.2\lib

/ LIBPATH:c:\Qt\4.6.2\lib/ NOLOGO
/ INCR EMENTAL:NO / MANIFEST
/ MANIFESTFILE:tmp\obj\release_static \assistant_adp.interme
diate.manifest/ SUBSYSTEM:WINDOWS
/ MANIFESTDEPENDENCY:type ='win32'
name ='Micro
soft.Windows.Common-Controls'
version ='6.0.0.0'
publicKeyToken ='6595b64144ccf1df'
language =''
processorArchitecture ='
'
/ OUT :...... \bin\assistant_adp.exe @C
:\DOCUME〜1\Geeko\LOCALS〜1\Temp\\\
m3F8.tmp
fontpanel.obj :MSIL .netmodule或
模块编译/ GL找到;
用/ LTCG重新启动li nk;添加/ LTCG
到链接命令行以提高
链接器性能main.obj:error
LNK2001:未解析的外部符号
类QObject * __cdecl qt
_plugin_instance_qjpeg void)(?qt_plugin_instance_qjpeg @@ YAPAVQObject @@ XZ)
... \bin\assistant_adp.exe:致命
错误LNK1120:1未解决的外部



NMAKE:致命错误U1077:
'C:\Program Files \Microsoft Visual
Studio 9.0 \VC\BIN \link.EXE': return
code'0x460'停止。



NMAKE:致命错误U1077:'C:\Program Files \Microsoft Visual Studio 9.0 \VC\\ \\ BIN \\\
make.exe':返回代码'0x2'停止。



NMAKE:致命错误U1077:'cd':返回代码'0x2'停止。 / p>

NMAKE:致命错误U1077:'cd':返回代码'0x2'停止。



NMAKE:致命错误U1077:'cd':返回代码'0x2'停止。


谢谢。



C:\Qt\\

\\4.6.2> configure -release -static -opensource -no-fast -no-exceptions -no-accessibility -no-rtti -no-stl -no-opengl -no-openvg -no-incredibuild-xge -no-style -plastique -no-style-cleanlooks -no-style-motif -no-style-cde -no-style-windowsce -no-style-windowsmobile -no-style-s60 -no-gif -no-libpng -no-libtiff -no-libjpeg -no-libmng -no-qt3support -no-mmx -no-3dnow -no-sse -no-sse2 -no-iwmmxt -no-openssl -no-dbus -platform win32-msvc2008 -arch windows -no -phonon -no-phonon-backend -no-multimedia -no-audio-backend -no-script -no-scripttools -webkit -no-declarative



在构建静态链接到QWebKit的项目时遇到这些错误:



1>创建库C:\Users\Geeko\Desktop\Qt\TestQ\\ \\Release\TestQ.lib和对象C:\Users\Geeko\Desktop\Qt\TestQ\Release\TestQ.exp



1 > QtWebKit.lib(PluginPackageWin.obj):错误LNK2019:未解析的外部符号_VerQueryValueW @ 16在函数中引用WebCore :: String __cdecl WebCore :: getVersionInfo(void * const,class WebCore :: String const&) getVersionInfo @ WebCore @@ YA?AVString @ 1 @ QAXABV21 @@ Z)



1> QtWebKit.lib(PluginPackageWin.obj):error LNK2019:unresolved external symbol _GetFileVersionInfoW @ 16在函数private:bool __thiscall WebCore :: PluginPackage :: fetchInfo(void)(?fetchInfo @ PluginPackage @ WebCore @@ AAE_NXZ)中引用



1> QtWebKit。 lib(PluginPackageWin.obj):error LNK2019:未解析的外部符号_GetFileVersionInfoSizeW @ 8引用在函数private:bool __thiscall WebCore :: PluginPackage :: fetchInfo(void)(?fetchInfo @ PluginPackage @ WebCore @@ AAE_NXZ)



1> QtWebKit.lib(PluginDatabaseWin.obj):错误LNK2019:未解析的外部符号__imp__PathRemoveFileSpecW @ 4在函数中引用WebCore :: String __cdecl WebCore :: safariPluginsDirectory ?safariPluginsDirectory @ WebCore @@ YA?AVString @ 1 @ XZ)



1> QtWebKit.lib(PluginDatabaseWin.obj):错误LNK2019:未解析的外部符号__imp__SHGetValueW @ 24引用在函数void __cdecl WebCore :: addWindowsMediaPlayerPluginDirectory(class WTF :: Vector&)(?addWindowsMediaPlayerPluginDirectory @ WebCore @@ YAXAAV?$ Vector @ VString @ WebCore @@ $ 0A @@ WTF @@@ Z)



1> QtWebKit.lib(PluginDatabaseWin.obj):错误LNK2019:未解析的外部符号__imp__PathCombineW @ 12引用的函数void __cdecl WebCore :: addMacromediaPluginDirectories(WTF :: Vector& (?addMacromediaPluginDirectories @ WebCore @@ YAXAAV?$ Vector @ VString @ WebCore @@ $ 0A @@ WTF @@@ Z)



1> C:\Users \Geeko\Desktop\Qt\TestQ\Release\TestQ.exe:致命错误LNK1120:6未解决的外部



我需要检查Qt项目选项?
我有QtCore,QtGui,网络和WebKit检查。


This what I did but it results in errors:

1: In win32-msvc2008\qmake.conf I set QMAKE_CFLAGS_RELEASE = -O1 -Og -GL -MD

2: From MSVC2008 CMD I run vcvarsall.bat x86 and vcvars32.bat "C:\Program Files\Microsoft Visual Studio 9.0\VC\bin

3: From Qt 4.6.2 CMD I run the following

C:\Qt\4.6.2>configure -release -nomake examples -nomake demos -no-exceptions -n o-stl -no-rtti -no-qt3support -no-scripttools -no-openssl -no-opengl -no-webkit -no-phonon -no-style-motif -no-style-cde -no-style-cleanlooks -no-style-plastique -no-sql-sqlite -platform win32-msvc2008 -static -qt-libjpeg -qt-zlib -qt-libpng

and then nmake

However, I ended up every time with these errors:

    link /LIBPATH:"c:\Qt\4.6.2\lib"

/LIBPATH:"c:\Qt\4.6.2\lib" /NOLOGO /INCR EMENTAL:NO /MANIFEST /MANIFESTFILE:"tmp\obj\release_static\assistant_adp.interme diate.manifest" /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Micro soft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df ' language='' processorArchitecture=''" /OUT:......\bin\assistant_adp.exe @C :\DOCUME~1\Geeko\LOCALS~1\Temp\nm3F8.tmp fontpanel.obj : MSIL .netmodule or module compiled with /GL found; restarting li nk with /LTCG; add /LTCG to the link command line to improve linker performance main.obj : error LNK2001: unresolved external symbol "class QObject * __cdecl qt _plugin_instance_qjpeg(void)" (?qt_plugin_instance_qjpeg@@YAPAVQObject@@XZ) ......\bin\assistant_adp.exe : fatal error LNK1120: 1 unresolved externals

NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN \link.EXE"' : return code '0x460' Stop.

NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.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.

NMAKE : fatal error U1077: 'cd' : return code '0x2' Stop.

Thank you in deed.

解决方案

I tried to do it with MS VS 2008 and it worked.

C:\Qt\4.6.2>configure -release -static -opensource -no-fast -no-exceptions -no-accessibility -no-rtti -no-stl -no-opengl -no-openvg -no-incredibuild-xge -no-style-plastique -no-style-cleanlooks -no-style-motif -no-style-cde -no-style-windowsce -no-style-windowsmobile -no-style-s60 -no-gif -no-libpng -no-libtiff -no-libjpeg -no-libmng -no-qt3support -no-mmx -no-3dnow -no-sse -no-sse2 -no-iwmmxt -no-openssl -no-dbus -platform win32-msvc2008 -arch windows -no-phonon -no-phonon-backend -no-multimedia -no-audio-backend -no-script -no-scripttools -webkit -no-declarative

However, I get these errors when building a project that links statically to QWebKit:

1> Creating library C:\Users\Geeko\Desktop\Qt\TestQ\Release\TestQ.lib and object C:\Users\Geeko\Desktop\Qt\TestQ\Release\TestQ.exp

1>QtWebKit.lib(PluginPackageWin.obj) : error LNK2019: unresolved external symbol _VerQueryValueW@16 referenced in function "class WebCore::String __cdecl WebCore::getVersionInfo(void * const,class WebCore::String const &)" (?getVersionInfo@WebCore@@YA?AVString@1@QAXABV21@@Z)

1>QtWebKit.lib(PluginPackageWin.obj) : error LNK2019: unresolved external symbol _GetFileVersionInfoW@16 referenced in function "private: bool __thiscall WebCore::PluginPackage::fetchInfo(void)" (?fetchInfo@PluginPackage@WebCore@@AAE_NXZ)

1>QtWebKit.lib(PluginPackageWin.obj) : error LNK2019: unresolved external symbol _GetFileVersionInfoSizeW@8 referenced in function "private: bool __thiscall WebCore::PluginPackage::fetchInfo(void)" (?fetchInfo@PluginPackage@WebCore@@AAE_NXZ)

1>QtWebKit.lib(PluginDatabaseWin.obj) : error LNK2019: unresolved external symbol __imp__PathRemoveFileSpecW@4 referenced in function "class WebCore::String __cdecl WebCore::safariPluginsDirectory(void)" (?safariPluginsDirectory@WebCore@@YA?AVString@1@XZ)

1>QtWebKit.lib(PluginDatabaseWin.obj) : error LNK2019: unresolved external symbol __imp__SHGetValueW@24 referenced in function "void __cdecl WebCore::addWindowsMediaPlayerPluginDirectory(class WTF::Vector &)" (?addWindowsMediaPlayerPluginDirectory@WebCore@@YAXAAV?$Vector@VString@WebCore@@$0A@@WTF@@@Z)

1>QtWebKit.lib(PluginDatabaseWin.obj) : error LNK2019: unresolved external symbol __imp__PathCombineW@12 referenced in function "void __cdecl WebCore::addMacromediaPluginDirectories(class WTF::Vector &)" (?addMacromediaPluginDirectories@WebCore@@YAXAAV?$Vector@VString@WebCore@@$0A@@WTF@@@Z)

1>C:\Users\Geeko\Desktop\Qt\TestQ\Release\TestQ.exe : fatal error LNK1120: 6 unresolved externals

Do I need to check something in the Qt project options ? I have QtCore, QtGui, Network and WebKit checked.

这篇关于静态编译Qt 4.6.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆