Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
静态编译Qt4.6.2_Qt_Static_Linker_Compilation - Fatal编程技术网

静态编译Qt4.6.2

静态编译Qt4.6.2,qt,static,linker,compilation,Qt,Static,Linker,Compilation,这就是我所做的,但会导致错误: 1:在win32-msvc2008\qmake.conf中,我设置了qmake\u CFLAGS\u RELEASE=-O1-Og-GL-MD 2:从MSVC2008 CMD运行vcvvarsall.bat x86和vcvvars32.bat”C:\Program Files\Microsoft Visual Studio 9.0\VC\bin 3:从Qt4.6.2 CMD运行以下命令 C:\Qt\4.6.2>配置-发布 -nomake示例-nomake演示-无例

这就是我所做的,但会导致错误:

1:在win32-msvc2008\qmake.conf中,我设置了
qmake\u CFLAGS\u RELEASE=-O1-Og-GL-MD

2:从MSVC2008 CMD运行
vcvvarsall.bat x86
vcvvars32.bat”C:\Program Files\Microsoft Visual Studio 9.0\VC\bin

3:从Qt4.6.2 CMD运行以下命令

C:\Qt\4.6.2>配置-发布 -nomake示例-nomake演示-无例外-n o-stl-无rtti-无QT3支持-无脚本工具-无openssl-无opengl-无webkit -无声子-无风格图案-无风格cde-无风格整洁外观-无风格塑像 -无sql sqlite-平台win32-msvc2008-静态-qt libjpeg -qt-zlib-qt-libpng

然后
nmake

但是,我每次都会犯以下错误:

/LIBPATH:“c:\Qt\4.6.2\lib”/NOLOGO /增量:无/清单 /清单文件:“tmp\obj\release\u static\assistant\u adp.interme” diate.manifest“/子系统:WINDOWS “/MANIFESTDEPENDENCY:type='win32' name='Micro soft.Windows.Common控件' 版本='6.0.0.0' publicKeyToken='6595b64144ccf1df' 语言=“” Processor架构=“” /输出:…\bin\assistant\u adp.exe@C :\DOCUME~1\Geeko\LOCALS~1\Temp\nm3F8.tmp fontpanel.obj:MSIL.netmodule或 找到使用/GL编译的模块; 使用/LTCG重新启动li nk;添加/LTCG 到链接命令行以改进 链接器性能main.obj:错误 LNK2001:未解析的外部符号 “类QObject*\uuu cdecl qt _plugin_instance_qjpeg(void)”(?qt_plugin_instance_qjpeg@@YAPAVQObject@@XZ) ..\bin\assistant\u adp.exe:致命 错误LNK1120:1个未解析的外部

NMAKE:致命错误U1077: ““C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.EXE“':返回 代码“0x460”停止

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

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

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

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


非常感谢。

尝试设置以下环境变量:

  • QTDIR
    :c:\Qt\4.6.2或解压Qt源的任何位置
  • QMAKESPEC
    :win32-msvc2008
  • %QTDIR%/bin
    路径

并使用“Visual Studio 2008命令提示符”(在VS2008中的“工具”菜单中)而不是Qt命令提示符。

我尝试使用MS VS 2008进行此操作,结果成功了

C:\Qt\4.6.2>configure-release-static-opensource-no-fast-no-exception-no-accessibility-no-rtti-no-stl-no-opengl-no-openvg-no-incredbuild-xge-no-style-plastique-no-style-motif-no-style-cde-no-style-windowsmobile-no-style-windowsmobile-no-libpng-no-libtiff-libjpeg-no-libmng-qt3支持-无mmx-无3dnow-无sse-无sse2-无iwmmxt-无openssl-无dbus-平台win32-msvc2008-arch windows-无声子-无声子后端-无多媒体-无音频后端-无脚本-无脚本工具-webkit-无声明性
但是,在构建静态链接到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<class WebCore::String,0> &)" (?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<class WebCore::String,0> &)" (?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
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在函数“class WebCore::String u cdecl WebCore::getVersionInfo(void*const,class WebCore::String const&)”中引用(?getVersionInfo@WebCore@@是吗?AVString@1@QAXABV21@@Z)
1> QtWebKit.lib(PluginPackageWin.obj):错误LNK2019:未解析的外部符号_GetFileVersionInfoW@16在函数“private:bool\uu thiscall WebCore::PluginPackage::fetchInfo(void)”中引用(?fetchInfo@PluginPackage@WebCore@@AAE_NXZ)
1> QtWebKit.lib(PluginPackageWin.obj):错误LNK2019:未解析的外部符号_GetFileVersionInfoSizeW@8在函数“private:bool\uu thiscall WebCore::PluginPackage::fetchInfo(void)”中引用(?fetchInfo@PluginPackage@WebCore@@AAE_NXZ)
1> QtWebKit.lib(PluginDatabaseWin.obj):错误LNK2019:未解析的外部符号\uuu imp__PathRemoveFileSpecW@4在函数“class WebCore::String uu cdecl WebCore::safariPluginsDirectory(void)”中引用(?safariPluginsDirectory@WebCore@@是吗?AVString@1@XZ)
1> QtWebKit.lib(PluginDatabaseWin.obj):错误LNK2019:未解析的外部符号\uuu imp__SHGetValueW@24在函数“void\uu cdecl WebCore::addWindowsMediaPlayerPluginDirectory(类WTF::Vector&)”中引用(?addWindowsMediaPlayerPluginDirectory@WebCore@@亚哈夫$Vector@VString@WebCore@$0A@@@WTF@@@Z)
1> QtWebKit.lib(PluginDatabaseWin.obj):错误LNK2019:未解析的外部符号\uuu imp__PathCombineW@12在函数“void\uu cdecl WebCore::addMacromediaPluginDirectories(类WTF::Vector&)”中引用(?addMacromediaPluginDirectories@WebCore@@亚哈夫$Vector@VString@WebCore@$0A@@@WTF@@@Z)
1> C:\Users\Geeko\Desktop\Qt\TestQ\Release\TestQ.exe:致命错误LNK1120:6个未解析的外部
我是否需要在Qt项目选项中检查某些内容?
我已经检查了QtCore、QtGui、网络和WebKit。

您是否考虑过Qt根据默认值选择的std::string类型

这是一个小小的编译器开关-Zc:wchar\u t-,它显式地将wchar\u t定义为无符号的short,而不是内置类型。
如果你在最后省略了-Zc:wchar\u t,那么它会发生变化,并且可能更适合你的项目。

谢谢你的回复。这就是我得到的。看起来有一些进展:)有什么想法吗?我遵循了这个:c1x:致命错误C1027:在创建和使用预编译的h之间/Ym的值不一致eader qsequentialanimationgroup.cpp c1xx:致命错误C1027:在创建和使用预编译标头QParallelLanimationGroup.cpp c1xx之间/Ym的值不一致:致命错误C1027:f的值不一致
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<class WebCore::String,0> &)" (?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<class WebCore::String,0> &)" (?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