1

1) ran "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd /x64 /Debug" to set environment variables.

2) ran "vcexpress" from that command prompt. The reason for starting from the command prompt is so that the correct compiler and linker are detected. Otherwise they defaulted to x86_amd64 when vcexpress is run from the start menu.

3) attempted to build my project, a SuperBuild generated by CMake which calls msbuild to compile some static solution files. Received this error:

You are attempting to build a Win32 application from an x64-environment. If using the Windows 7.1 SDK build environment, type setenv / x86

4

1 回答 1

3

解决方案是更改 TARGET_CPU 变量。当 setenv /x64 /debug 运行时,它设置:

C:\Temp\cmakeex\build>echo %TARGET_CPU% x64

我将其更改为 amd64,现在项目构建成功:

> 设置 TARGET_CPU=amd64

于 2012-02-17T19:56:21.727 回答