1

我需要在我的 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

我已经尝试通过 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 露水

4

1 回答 1

2

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

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

评论或删除

#include <winable.h>

src\kernel\qaccessible_win.cpp

configure.bat --help

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

cd bin
configure.exe -no-dsp -v

如果出现错误 C3688: invalid literal suffix 'QTDLL_POSTFIX'

删除此文件中的所有 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;

qmake\generators\win32\winmakefile.cpp

重新运行

configure.exe -no-dsp -v

它现在应该可以成功编译

于 2016-11-10T17:24:55.593 回答