Win32到Win64移植编译问题
我正在将一个项目从 Win32 移植到 Win64。我们正在使用 make 文件,但出现以下错误
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\codeanalysis\sourceannotations.h(17) : error C2371: 'size_t' : redefinition; different basic types1>
binding.cpp : see declaration of 'size_t'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnt.h(81) : fatal error C1189: #error : "No Target Architecture"
我们正在使用以下 CFLAGS 进行编译:
1> cl.exe /nologo /MTd /GR /W3 /Zi /EHsc /Od /I“....\include”/I“C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include”/I “C:\ Program Files(x86)\ Microsoft Visual Studio 9.0 \ VC \ PlatformSDK \ include”/ I“C:\ Program Files \ Microsoft SDKs \ Windows \ v6.0A \ Include”/ D_X86_ / D_WIN64 / D_WIN32 / D“ _DEBUG" /D "_WINDOWS" /D_CRT_SECURE_NO_WARNINGS /Fo".\Debug\" /Fd".\Debug\" /FD /c "test.cpp"
我不知道缺少哪些设置。
I am porting a project from Win32 to Win64. We are using make file but we get the following error
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\codeanalysis\sourceannotations.h(17) : error C2371: 'size_t' : redefinition; different basic types1>
binding.cpp : see declaration of 'size_t'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnt.h(81) : fatal error C1189: #error : "No Target Architecture"
We are copmiling with following CFLAGS:
1> cl.exe /nologo /MTd /GR /W3 /Zi /EHsc /Od /I "....\include" /I"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include" /I"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\PlatformSDK\include" /I"C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include" /D_X86_ /D_WIN64 /D_WIN32 /D "_DEBUG" /D "_WINDOWS" /D_CRT_SECURE_NO_WARNINGS /Fo".\Debug\" /Fd".\Debug\" /FD /c "test.cpp"
I don't know which settings I am missing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您尝试在 64 位模式下编译代码时,标头 winnt.h 预计应定义
_AMD64_
或_IA64_
。如果您使用正确的编译器,它们可能会由编译器自动设置。检查您是否使用 64 位版本的 cl.exe。
The header winnt.h expects that either
_AMD64_
or_IA64_
should be defined when you're trying to compile the code in 64-bit mode.They may be set by the compiler automatically if you use the right compiler. Check that you're using the 64-bit version of cl.exe.