如何编译Qt 3.3.6用于VC2012?

时间:2016-11-10 10:47:07

标签: qt visual-c++ visual-studio-2012 qt3

我需要在Win 7 PC上编译Qt 3.3.6,以便与我的MSVC2012 C ++编译器(MSVS 2012 Professional)结合使用。

原因很简单,我有一个Qt 3.3.6许可证和许多Qt 3.3.6源代码。因此,Qt升级不是一种选择。 “谷歌”没有帮助......

编辑:16/11/10 1:40 pm

我已经尝试通过VS2012(Tools / VisualStudioCommandPrompt)启动shell并将cwd更改为包含相应Makefile的Qt目录来编译它:

C:\Qt\3.3.6>bin\configure.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:\Qt\3.3.6
Install prefix..............C:\Qt\3.3.6
Headers installed to........C:\Qt\3.3.6\include
Libraries installed to......C:\Qt\3.3.6\lib
Plugins installed to........C:\Qt\3.3.6\plugins
Binaries installed to.......C:\Qt\3.3.6\bin
Docs installed to...........C:\Qt\3.3.6\doc
Data installed to...........C:\Qt\3.3.6
Translations installed to...C:\Qt\3.3.6\translations


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

1 个答案:

答案 0 :(得分:1)

尝试使用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%

在以下文件中用MAX_PATH替换PATH_MAX:

src\tools\qdir_win.cpp
src\tools\qdir.cpp

评论或删除

#include <winable.h>

来自

src\kernel\qaccessible_win.cpp

运行

configure.bat --help

将在bin文件夹中生成configure.exe和link_includes.exe。

cd bin
configure.exe -no-dsp -v

如果您收到错误消息C3688:无效的文字后缀&#39; QTDLL_POSTFIX&#39;

删除此文件中的所有QTDLL_POSTFIX:

qmake\generators\win32\borland_bmake.cpp
qmake\generators\win32\mingw_make.cpp
qmake\generators\win32\msvc_dsp.cpp
qmake\generators\win32\msvc_nmake.cpp
qmake\generators\win32\msvc_vcproj.cpp

并更改

QString dllStem = stem + QTDLL_POSTFIX;

QString dllStem = stem;

in

qmake\generators\win32\winmakefile.cpp

重新运行

configure.exe -no-dsp -v

现在应该成功编译