我有一个包含许多项目的 Visual Studio 解决方案。There are debug and release configurations for both x86 and x64, and when a particular combination is selected everything is successfully built in that format.
但是,现在有一个要求,即无论当前选择的“位数”如何,某个 C++ 项目都应编译为 x86 和 x64。所以举例来说,当解决方案以x86调试模式构建时,构建目录下应该有两个exe的调试副本,一个x86,一个x64。
实现这一目标的最简单方法是什么?我尝试制作项目的两个副本,exename_32 和 exename_64。我的第一个想法是将 .vcproj 文件中 Debug|x64 节点的内容复制到 exename_64 的 Debug|Win32 节点中。但是当我尝试在 Win32 模式下构建解决方案时,exename_64 项目出现以下错误:
20>c:\program files (x86)\microsoft visual studio 9.0\vc\include\codeanalysis\sourceannotations.h(17):错误 C2371:'size_t':重新定义;不同的基本类型
20> 预定义的 C++ 类型(编译器内部)(19):参见“size_t”的声明
20>C:\Users\melol\Desktop\local\march03\src\thirdparty\Microsoft SDKs\Windows\v6.0\include\winnt.h(81):致命错误 C1189:#error:“无目标架构”
有问题的 exe 是一个带有 wWinMain 的 Windows 命令行实用程序。仅有的两个#include 是
#include <windows.h>
#include <iostream>
想法?