Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ Visual Studio Professional 2013,更新版5“;“无目标架构”;_C++_Visual Studio - Fatal编程技术网

C++ Visual Studio Professional 2013,更新版5“;“无目标架构”;

C++ Visual Studio Professional 2013,更新版5“;“无目标架构”;,c++,visual-studio,C++,Visual Studio,我在Visual Studio中有一个CPP项目,当我尝试构建解决方案时,我收到以下消息: 1>c:\program files (x86)\windows kits\8.1\include\um\winnt.h(147): fatal error C1189: #error : "No Target Architecture" #include "targetver.h" #include <Windows.h> #include <

我在Visual Studio中有一个CPP项目,当我尝试构建解决方案时,我收到以下消息:

    1>c:\program files (x86)\windows kits\8.1\include\um\winnt.h(147): fatal error C1189: #error :  "No Target Architecture"
    #include "targetver.h"
    #include <Windows.h>

    #include <stdio.h>
    #include <tchar.h>
    #include <iostream>
    #include <chrono>
    #include <ctime>
    #include <time.h>
    #include <fstream>
    #include <profileapi.h>
    #include <sys/stat.h>
    #include <sys/types.h>
stdafx.h的内容:

    #pragma once

    #include "targetver.h"

    #include <stdio.h>
    #include <tchar.h>
    #include <ctime>
    #include <time.h>
    #include <iostream>
    #include <profileapi.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <Windows.h>
#pragma一次
#包括“targetver.h”
#包括
#包括
#包括
#包括
#包括
#包括
#包括
#包括
#包括

缺少什么?

最后我发现删除标题:

    profileapi.h
    sys/types.h
解决了该问题,项目现在生成时没有警告或错误

谢谢戴,更好的解决方案:

    1>c:\program files (x86)\windows kits\8.1\include\um\winnt.h(147): fatal error C1189: #error :  "No Target Architecture"
    #include "targetver.h"
    #include <Windows.h>

    #include <stdio.h>
    #include <tchar.h>
    #include <iostream>
    #include <chrono>
    #include <ctime>
    #include <time.h>
    #include <fstream>
    #include <profileapi.h>
    #include <sys/stat.h>
    #include <sys/types.h>
#包括“targetver.h”
#包括
#包括
#包括
#包括
#包括
#包括
#包括
#包括
#包括
#包括
#包括

我建议你可以参考链接:。@Jeaninez MSFT,对不起,在我发布我的问题之前,我看到并读到了这一点,它没有任何帮助。我怀疑你需要删除
#包括
(你不应该使用
TCHAR
,反正它已经完全过时18年了)。还要确保其他include文件(例如
targetver.h
)没有任何
#include
行。我认为问题在于
profileapi.h
,因为它是一个Windows标头,这意味着它必须包含在
include
之后。您仍然可以在
stdafx.h
文件中包含这些标头,但您只需确保它们位于
#include
行下方。