问题
I am using Qt Creator to create some shared library and application projects so that I can easily build them on Windows and Linux. On Windows, some of us prefer using Visual Studio so I want to generate Visual Studio solution and project files from the Qt .pro files using qmake -tp vc -r file.pro. Everything works exactly as expected except that the generated Visual Studio solution and projects only contain 32-bit build configurations and I need 64-bit configurations. It's not a big deal to create the 64-bit configuration in Visual Studio but it would be an easy step to overlook for somebody. I'm wondering if there's a way to do it automatically by either adding something to my .pro files or as an argument to qmake?
回答1:
Run this command from the Visual Studio Command Shell Native x64.
If you need this functionality in any sort of batch files etc, just invoke appropriate bat file from VS Command Tools, like vcvarsx86_amd64.bat or vcvarsx86.bat to set a proper environment
来源:https://stackoverflow.com/questions/38248343/how-to-generate-64-bit-visual-studio-projects-from-qmake