<legend id='ivMZP'><style id='ivMZP'><dir id='ivMZP'><q id='ivMZP'></q></dir></style></legend>

  • <i id='ivMZP'><tr id='ivMZP'><dt id='ivMZP'><q id='ivMZP'><span id='ivMZP'><b id='ivMZP'><form id='ivMZP'><ins id='ivMZP'></ins><ul id='ivMZP'></ul><sub id='ivMZP'></sub></form><legend id='ivMZP'></legend><bdo id='ivMZP'><pre id='ivMZP'><center id='ivMZP'></center></pre></bdo></b><th id='ivMZP'></th></span></q></dt></tr></i><div id='ivMZP'><tfoot id='ivMZP'></tfoot><dl id='ivMZP'><fieldset id='ivMZP'></fieldset></dl></div>

    <small id='ivMZP'></small><noframes id='ivMZP'>

    • <bdo id='ivMZP'></bdo><ul id='ivMZP'></ul>
    <tfoot id='ivMZP'></tfoot>

      1. 致命错误:“无目标架构"在 Visual Studio 中

        时间:2023-06-03
          • <bdo id='Hk7ev'></bdo><ul id='Hk7ev'></ul>

            <small id='Hk7ev'></small><noframes id='Hk7ev'>

            <legend id='Hk7ev'><style id='Hk7ev'><dir id='Hk7ev'><q id='Hk7ev'></q></dir></style></legend>

              <tbody id='Hk7ev'></tbody>
            1. <i id='Hk7ev'><tr id='Hk7ev'><dt id='Hk7ev'><q id='Hk7ev'><span id='Hk7ev'><b id='Hk7ev'><form id='Hk7ev'><ins id='Hk7ev'></ins><ul id='Hk7ev'></ul><sub id='Hk7ev'></sub></form><legend id='Hk7ev'></legend><bdo id='Hk7ev'><pre id='Hk7ev'><center id='Hk7ev'></center></pre></bdo></b><th id='Hk7ev'></th></span></q></dt></tr></i><div id='Hk7ev'><tfoot id='Hk7ev'></tfoot><dl id='Hk7ev'><fieldset id='Hk7ev'></fieldset></dl></div>
                  <tfoot id='Hk7ev'></tfoot>
                  本文介绍了致命错误:“无目标架构"在 Visual Studio 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  当我尝试在 Win32 或 x64 模式下使用 Visual Studio 2010 编译我的 C++ 项目时,出现以下错误:

                  When I try to compile my c++ project using Visual Studio 2010 in either Win32 or x64 mode I get the following error:

                  >C:Program Files (x86)Microsoft SDKsWindowsv7.0Aincludewinnt.h(135):致命错误 C1189:#error:无目标架构"

                  我的预处理器定义说 WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)

                  My preprocessor definitions say WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)

                  是什么导致了这个错误,我该如何解决?

                  What is causing this error and how do I fix it?

                  // winnt.h: lines 127-136, MSVS says this is an inactive preprocessor block
                  #if defined(_WIN64)
                  
                  #if defined(_AMD64_)
                  #define PROBE_ALIGNMENT( _s ) TYPE_ALIGNMENT( DWORD )
                  #elif defined(_IA64_)
                  #define PROBE_ALIGNMENT( _s ) (TYPE_ALIGNMENT( _s ) > TYPE_ALIGNMENT( DWORD ) ? 
                                                TYPE_ALIGNMENT( _s ) : TYPE_ALIGNMENT( DWORD ))
                  #else
                  #error "No Target Architecture"
                  #endif
                  

                  更新:我创建了一个新的 msvs 项目并将我的代码复制到其中.我不再有 error : "No Target Architecture",但现在我有一堆涉及 winnt.h 和 winbase.h 的编译错误,并且没有涉及我的任何文件的编译错误.这些文件是否可能已损坏?我是否需要重新安装 MSVS 2010?

                  Update: I created a new msvs project and copied my code to it. I no longer have error : "No Target Architecture", but now I have a bunch of compile errors involving winnt.h and winbase.h and no compile errors involving any of my files. Is it possible these files are corrupted? Do I need to reinstall MSVS 2010?

                  更新 2:所以我缩小了我的问题范围,发现是 #include <WinDef.h> 导致了我所有的 winnt.h 编译错误,但我仍然没有知道如何修复它.

                  Update 2: So I narrowed down my problem and found that it is #include <WinDef.h> that is causing all of my compile errors with winnt.h but I still don't know how to fix it.

                  推荐答案

                  使用 #include 而不是 #include .

                  来自 windows.h 维基百科页面:

                  From the windows.h wikipedia page:

                  windows.h 会自动包含许多子头文件.由于依赖关系,其中许多文件不能简单地单独包含(它们不是自包含).

                  There are a number of child header files that are automatically included with windows.h. Many of these files cannot simply be included by themselves (they are not self-contained), because of dependencies.

                  windef.hwindows.h 自动包含的文件之一.

                  windef.h is one of the files automatically included with windows.h.

                  这篇关于致命错误:“无目标架构"在 Visual Studio 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何从 dll 导出 C++ 类? 下一篇:Visual C++ 上 NOMINMAX 的可能问题

                  相关文章

                    <i id='LTYRY'><tr id='LTYRY'><dt id='LTYRY'><q id='LTYRY'><span id='LTYRY'><b id='LTYRY'><form id='LTYRY'><ins id='LTYRY'></ins><ul id='LTYRY'></ul><sub id='LTYRY'></sub></form><legend id='LTYRY'></legend><bdo id='LTYRY'><pre id='LTYRY'><center id='LTYRY'></center></pre></bdo></b><th id='LTYRY'></th></span></q></dt></tr></i><div id='LTYRY'><tfoot id='LTYRY'></tfoot><dl id='LTYRY'><fieldset id='LTYRY'></fieldset></dl></div>
                      <bdo id='LTYRY'></bdo><ul id='LTYRY'></ul>
                  1. <tfoot id='LTYRY'></tfoot>
                  2. <legend id='LTYRY'><style id='LTYRY'><dir id='LTYRY'><q id='LTYRY'></q></dir></style></legend>

                    <small id='LTYRY'></small><noframes id='LTYRY'>