4

現在、Visual Studio 2008のプロジェクトを作成するためにqmakeファイルと.proファイルを使用していますが、デフォルトのソリューションプラットフォームはWin32です。プロジェクトを再構築するたびに、構成マネージャーに移動し、Win32ソリューションから設定をコピーして、プラットフォームをx64に手動で変更する必要があります。

x64ビルド用に構成されたVS2008ソリューションを自動的に作成する方法をオンライン/QTフォーラムで見つけることができませんでした。QT用に独自のmakespecを作成する必要がありますか?x64固有のVSフラグを指定する必要がありますか?x64仕様のプロジェクトを作成するために正常に使用した投稿可能な例はありますか?

4

3 に答える 3

4

これは既知の問題です。Qtバグトラッカーには、QTBUG-6910QTBUG-4046という2つの関連するバグがあります。この2番目のエントリには、Qtを自分でビルドする場合に使用できるパッチへのリンクもあります。この問題の可視性を高めるために修正されるバグに投票してください。

于 2010-10-18T20:52:43.547 に答える
2

Thanks to the_mandrill, this is the solution:

First, you need to download patch 3891. Then, you need to apply the patch - you could find a patch utility for windows, but I just edited the files diffed in the patch manually; the files are in \qmake\generators\win32

Then, you need to build QT from scratch, which is done by navigating in command prompt (make sure it's the Visual Studio 2008 x64 command prompt from the Visual Studio directory) to the directory you installed QT in, presumably C:/QT/4.7.0, and typing configure, then nmake.

Building QT will take a long time. In the meantime, adding these to your qmake files will automatically detect your host OS. Keep in mind that this solution does NOT produce both win32 and x64 configurations on x64 - only the x64 configuration.

contains(QMAKE_HOST.arch, x86):{
QMAKE_LFLAGS *= /MACHINE:X86
}

contains(QMAKE_HOST.arch, x86_64):{
QMAKE_LFLAGS *= /MACHINE:X64
}

This produces a working x64 Visual Studio solution that compiles and links without errors.

于 2010-10-19T20:02:01.843 に答える
1

これは4.8で修正されました。

VS x64コマンドプロンプトからqmakeを実行して、PATH変数でamd64コンパイラを検出できるようにする必要があります。

于 2013-08-09T11:41:57.333 に答える