我需要在我的win7 PC上编译Qt 3.3.6,以便与我的MSVC2012 c++编译器(MSVS 2012 Professional)结合使用。
原因很简单,我有一个Qt 3.3.6许可证和大量的Qt 3.3.6源代码。因此,Qt升级不是一个选择。"Google"没有帮助…
编辑:16/11/10 1:40 pm
我已经尝试通过VS2012 (Tools/VisualStudioCommandPrompt)启动shell并将cwd更改为包含适当Makefile的Qt目录来编译它:
C:Qt3.3.6>binconfigure.exe -redo -spec win32-msvc2012
License file not found in C:/Users/mdew
Enterprise modules will not be available.
QMAKESPEC...................win32-msvc
Maketool....................nmake
[...list of all the installed programs...]
Configuration:
nocrosscompiler
dialogs
iconview
kernel
styles
tools
widgets
workspace
minimal-config
small-config
medium-config
large-config
full-config
release
thread
no-gif
zlib
jpeg
mng
png
bigcodecs
no-tablet
Debug symbols...............no
Thread support..............yes
Accessibility support.......no
Big Textcodecs..............yes
Tablet support..............no
STL support.................yes
Additional exports..........no
Exception support...........yes
RTTI support................yes
OpenGL support..............no
Image formats:
GIF support.............no
MNG support.............qt
JPEG support............qt
PNG support.............qt
Styles:
Windows.................yes
Windows XP..............no
Motif...................yes
Platinum................yes
MotifPlus...............yes
CDE.....................yes
SGI.....................yes
Sql Drivers:
ODBC....................no
MySQL...................no
OCI.....................no
PostgreSQL..............no
TDS.....................no
DB2.....................no
SQLite..................no
Interbase...............no
Sources are in..............C:Qt3.3.6
Install prefix..............C:Qt3.3.6
Headers installed to........C:Qt3.3.6include
Libraries installed to......C:Qt3.3.6lib
Plugins installed to........C:Qt3.3.6plugins
Binaries installed to.......C:Qt3.3.6bin
Docs installed to...........C:Qt3.3.6doc
Data installed to...........C:Qt3.3.6
Translations installed to...C:Qt3.3.6translations
Creating qmake...
Microsoft (R) Program Maintenance Utility Version 11.00.61030.0
Copyright (C) Microsoft Corporation. All rights reserved.
cd qmake
NMAKE : fatal error U1077: 'cd' : return code '0x1'
Stop.
Building qmake failed, return code 2
所以,我试图通过MSVS2012编译它失败了。NMAKE有麻烦了
我做错了什么?
提前感谢你的任何提示!
BR mdew
我尝试用MSVC2015从源代码编译Qt 3.3.6,我已经成功了。
从https://sourceforge.net/projects/qtwin/files/Unofficial%20Qtwin/qt-win-3.3.6-6/下载Qt 3源码
必须有QTDIR环境变量
set QTDIR=<your path to Qt 3 folder>
确保bin文件夹在你的PATH
set PATH=%QTDIR%bin;%PATH%
将以下文件中的PATH_MAX替换为MAX_PATH:
srctoolsqdir_win.cpp
srctoolsqdir.cpp
注释或删除
#include <winable.h>
从srckernelqaccessible_win.cpp
运行configure.bat --help
configure.exe和link_includes.exe将在bin文件夹中生成。
cd bin
configure.exe -no-dsp -v
如果你得到错误保存错误C3688:无效的文字后缀'QTDLL_POSTFIX'
删除文件中所有的QTDLL_POSTFIX:
qmakegeneratorswin32borland_bmake.cpp
qmakegeneratorswin32mingw_make.cpp
qmakegeneratorswin32msvc_dsp.cpp
qmakegeneratorswin32msvc_nmake.cpp
qmakegeneratorswin32msvc_vcproj.cpp
和更改
QString dllStem = stem + QTDLL_POSTFIX;
QString dllStem = stem;
qmakegeneratorswin32winmakefile.cpp
重新运行
configure.exe -no-dsp -v
现在应该可以成功编译了