Win32到Win64移植编译问题

发布于 2024-10-03 05:31:34 字数 930 浏览 1 评论 0原文

我正在将一个项目从 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谜兔 2024-10-10 05:31:34

当您尝试在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文