简体   繁体   English

无法编译简单的Hello World C ++

[英]Can't compile simple hello world C++

I'm trying to run a simple hello world on my pc but when I try to compile it I have a lot of errors coming from Cmath, stdio, stdlib. 我试图在PC上运行一个简单的hello世界,但是当我尝试对其进行编译时,我遇到了来自Cmath,stdio,stdlib的许多错误。 I've thought about the environment variable but I don't know where it could come from. 我已经考虑过环境变量,但是我不知道它可能来自哪里。

I've tried to create another project and reinstalled visual studio. 我试图创建另一个项目并重新安装Visual Studio。 I'm on windows 8.1, have windows sdk and use visual studio 2015 community. 我在Windows 8.1上,安装了Windows SDK,并使用Visual Studio 2015社区。

My code for the hello world: 我的问候世界代码:

#include "stdafx.h"
#include <iostream>

int main()
{
    std::cout<<"hello world"<<std::endl;
    return 0;
}

Here is the output: 这是输出:

1>------ Build started: Project: ConsoleApplication1, Configuration: Debug Win32 ------
1>  stdafx.cpp
1>d:\visual studio\vc\include\stdio.h(295): error C2144: syntax error: 'int' should be preceded by ';'
1>d:\visual studio\vc\include\stdio.h(295): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(297): error C2144: syntax error: 'int' should be preceded by ';'
1>d:\visual studio\vc\include\stdio.h(297): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(297): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\stdio.h(304): error C2144: syntax error: 'int' should be preceded by ';'
1>d:\visual studio\vc\include\stdio.h(304): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(304): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\stdio.h(307): error C2144: syntax error: 'int' should be preceded by ';'
1>d:\visual studio\vc\include\stdio.h(307): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(307): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\stdio.h(316): error C2144: syntax error: 'int' should be preceded by ';'
1>d:\visual studio\vc\include\stdio.h(316): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(316): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\stdio.h(318): error C2144: syntax error: 'int' should be preceded by ';'
1>d:\visual studio\vc\include\stdio.h(318): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(318): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\stdio.h(321): error C2144: syntax error: 'int' should be preceded by ';'
1>d:\visual studio\vc\include\stdio.h(321): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(321): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\stdio.h(322): error C2144: syntax error: 'int' should be preceded by ';'
1>d:\visual studio\vc\include\stdio.h(322): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(322): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\stdio.h(345): error C2144: syntax error: 'int' should be preceded by ';'
1>d:\visual studio\vc\include\stdio.h(345): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(345): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\stdio.h(349): warning C4003: not enough actual parameters for macro '__DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_2_ARGLIST_EX'
1>d:\visual studio\vc\include\stdio.h(349): error C2146: syntax error: missing ';' before identifier '_vsnprintf'
1>d:\visual studio\vc\include\stdio.h(349): error C2143: syntax error: missing ',' before '*'
1>d:\visual studio\vc\include\stdio.h(349): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(349): error C2199: syntax error: found 'char (' at global scope (was a declaration intended?)
1>d:\visual studio\vc\include\stdio.h(349): error C2062: type 'char' unexpected
1>d:\visual studio\vc\include\stdio.h(352): error C2144: syntax error: 'int' should be preceded by ';'
1>d:\visual studio\vc\include\stdio.h(352): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(352): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\stdio.h(357): warning C4003: not enough actual parameters for macro '__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_ARGLIST'
1>d:\visual studio\vc\include\stdio.h(357): error C2146: syntax error: missing ';' before identifier 'vsprintf'
1>d:\visual studio\vc\include\stdio.h(357): error C2143: syntax error: missing ',' before '*'
1>d:\visual studio\vc\include\stdio.h(357): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(357): error C2365: 'sprintf': redefinition; previous definition was 'data variable'
1>  d:\visual studio\vc\include\stdio.h(357): note: see declaration of 'sprintf'
1>d:\visual studio\vc\include\stdio.h(390): error C2144: syntax error: 'int' should be preceded by ';'
1>d:\visual studio\vc\include\stdio.h(390): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(390): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\stdio.h(393): error C2144: syntax error: 'int' should be preceded by ';'
1>d:\visual studio\vc\include\stdio.h(393): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(393): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\stdio.h(402): error C2144: syntax error: 'int' should be preceded by ';'
1>d:\visual studio\vc\include\stdio.h(402): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(402): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\stdio.h(457): error C2144: syntax error: 'int' should be preceded by ';'
1>d:\visual studio\vc\include\stdio.h(457): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(457): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\stdio.h(461): error C2144: syntax error: 'int' should be preceded by ';'
1>d:\visual studio\vc\include\stdio.h(461): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(461): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\stdio.h(468): error C2144: syntax error: 'int' should be preceded by ';'
1>d:\visual studio\vc\include\stdio.h(468): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(468): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\stdio.h(470): error C2144: syntax error: 'int' should be preceded by ';'
1>d:\visual studio\vc\include\stdio.h(470): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(470): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\stdio.h(474): warning C4003: not enough actual parameters for macro '__DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_2_ARGLIST_EX'
1>d:\visual studio\vc\include\stdio.h(474): error C2146: syntax error: missing ';' before identifier '_vsnwprintf'
1>d:\visual studio\vc\include\stdio.h(474): error C2143: syntax error: missing ',' before '*'
1>d:\visual studio\vc\include\stdio.h(474): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(474): error C2199: syntax error: found 'wchar_t (' at global scope (was a declaration intended?)
1>d:\visual studio\vc\include\stdio.h(474): error C2062: type 'wchar_t' unexpected
1>d:\visual studio\vc\include\stdio.h(502): error C2144: syntax error: 'int' should be preceded by ';'
1>d:\visual studio\vc\include\stdio.h(502): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(502): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\stdio.h(505): error C2144: syntax error: 'int' should be preceded by ';'
1>d:\visual studio\vc\include\stdio.h(505): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(505): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\stdio.h(512): error C2144: syntax error: 'int' should be preceded by ';'
1>d:\visual studio\vc\include\stdio.h(512): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(512): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\stdio.h(514): error C2144: syntax error: 'int' should be preceded by ';'
1>d:\visual studio\vc\include\stdio.h(514): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(514): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\stdio.h(530): warning C4003: not enough actual parameters for macro '__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_ARGLIST_EX'
1>d:\visual studio\vc\include\stdio.h(530): error C2146: syntax error: missing ';' before identifier '_swprintf_s'
1>d:\visual studio\vc\include\stdio.h(530): error C2143: syntax error: missing ',' before '*'
1>d:\visual studio\vc\include\stdio.h(530): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(530): error C2146: syntax error: missing ';' before identifier 'vswprintf_s'
1>d:\visual studio\vc\include\stdio.h(530): error C2733: 'vswprintf_s': second C linkage of overloaded function not allowed
1>  d:\visual studio\vc\include\stdio.h(461): note: see declaration of 'vswprintf_s'
1>d:\visual studio\vc\include\stdio.h(531): warning C4003: not enough actual parameters for macro '__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_2_ARGLIST_EX'
1>d:\visual studio\vc\include\stdio.h(531): error C2146: syntax error: missing ';' before identifier '__vswprintf_l'
1>d:\visual studio\vc\include\stdio.h(531): error C2143: syntax error: missing ',' before '*'
1>d:\visual studio\vc\include\stdio.h(531): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(531): error C2146: syntax error: missing ';' before identifier '_vswprintf_s_l'
1>d:\visual studio\vc\include\stdio.h(531): error C2733: '_vswprintf_s_l': second C linkage of overloaded function not allowed
1>  d:\visual studio\vc\include\stdio.h(505): note: see declaration of '_vswprintf_s_l'
1>d:\visual studio\vc\include\swprintf.inl(40): error C3861: '_crt_va_start': identifier not found
1>d:\visual studio\vc\include\swprintf.inl(42): error C3861: '_crt_va_end': identifier not found
1>d:\visual studio\vc\include\swprintf.inl(64): error C3861: '_crt_va_start': identifier not found
1>d:\visual studio\vc\include\swprintf.inl(66): error C3861: '_crt_va_end': identifier not found
1>d:\visual studio\vc\include\swprintf.inl(88): error C3861: '_crt_va_start': identifier not found
1>d:\visual studio\vc\include\swprintf.inl(89): error C3861: '_vswprintf': identifier not found
1>d:\visual studio\vc\include\swprintf.inl(90): error C3861: '_crt_va_end': identifier not found
1>d:\visual studio\vc\include\swprintf.inl(99): error C3861: '_vswprintf': identifier not found
1>d:\visual studio\vc\include\swprintf.inl(108): error C3861: '_crt_va_start': identifier not found
1>d:\visual studio\vc\include\swprintf.inl(109): error C2660: '__vswprintf_l': function does not take 4 arguments
1>d:\visual studio\vc\include\swprintf.inl(110): error C3861: '_crt_va_end': identifier not found
1>d:\visual studio\vc\include\swprintf.inl(119): error C2660: '__vswprintf_l': function does not take 4 arguments
1>d:\visual studio\vc\include\stdio.h(571): error C2144: syntax error: 'int' should be preceded by ';'
1>d:\visual studio\vc\include\stdio.h(571): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(571): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\stdio.h(573): error C2144: syntax error: 'int' should be preceded by ';'
1>d:\visual studio\vc\include\stdio.h(573): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(573): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\stdio.h(576): error C2144: syntax error: 'int' should be preceded by ';'
1>d:\visual studio\vc\include\stdio.h(576): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(576): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\stdio.h(577): error C2144: syntax error: 'int' should be preceded by ';'
1>d:\visual studio\vc\include\stdio.h(577): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(577): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\stdio.h(581): error C2144: syntax error: 'int' should be preceded by ';'
1>d:\visual studio\vc\include\stdio.h(581): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(581): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\stdio.h(583): error C2144: syntax error: 'int' should be preceded by ';'
1>d:\visual studio\vc\include\stdio.h(583): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\stdio.h(583): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\wchar.h(968): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\wchar.h(968): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\wchar.h(968): error C2146: syntax error: missing ';' before identifier 'errno_t'
1>d:\visual studio\vc\include\wchar.h(986): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\wchar.h(986): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\wchar.h(986): error C2146: syntax error: missing ';' before identifier 'errno_t'
1>d:\visual studio\vc\include\wchar.h(1015): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\wchar.h(1015): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\wchar.h(1015): error C2146: syntax error: missing ';' before identifier 'errno_t'
1>d:\visual studio\vc\include\wchar.h(1022): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\wchar.h(1022): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\wchar.h(1022): error C2146: syntax error: missing ';' before identifier 'errno_t'
1>d:\visual studio\vc\include\wchar.h(1042): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\wchar.h(1042): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\wchar.h(1042): error C2146: syntax error: missing ';' before identifier 'errno_t'
1>d:\visual studio\vc\include\wchar.h(1053): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\wchar.h(1053): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\wchar.h(1053): error C2146: syntax error: missing ';' before identifier 'errno_t'
1>d:\visual studio\vc\include\wchar.h(1062): error C2144: syntax error: 'wchar_t' should be preceded by ';'
1>d:\visual studio\vc\include\wchar.h(1062): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\wchar.h(1062): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\wchar.h(1074): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\wchar.h(1074): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\wchar.h(1074): error C2146: syntax error: missing ';' before identifier 'errno_t'
1>d:\visual studio\vc\include\wchar.h(1078): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio\vc\include\wchar.h(1078): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1>  d:\visual studio\vc\include\stdio.h(295): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>d:\visual studio\vc\include\wchar.h(1078): fatal error C1003: error count exceeds 100; stopping compilation
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Your code looks fine, (apart from the include "stdafx.h", which you mentioned you removed in a comment), so it is probably something to do with your project setup. 您的代码看起来不错(除了在注释中提到的“ stdafx.h”之外),所以这可能与项目设置有关。 Try creating a new project, but try making an 'Empty Project' instead, found under the 'Visual C++' then 'General' tab. 尝试创建一个新项目,但尝试创建一个“空项目”,该项目位于“ Visual C ++”和“常规”选项卡下。

Not sure if you are still looking for the solution. 不知道您是否还在寻找解决方案。

See the following article on the Visual C++ Team Blog: "Introducing the Universal CRT" ( http://blogs.msdn.com/b/vcblog/archive/2015/03/03/introducing-the-universal-crt.aspx ). 请参阅Visual C ++团队博客上的以下文章:“通用CRT简介”( http://blogs.msdn.com/b/vcblog/archive/2015/03/03/introducing-the-universal-crt.aspx ) 。

Your project is missing that directory (C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.10069.0\\ucrt) from its include path. 您的项目的包含路径中缺少该目录(C:\\ Program Files(x86)\\ Windows Kits \\ 10 \\ Include \\ 10.0.10069.0 \\ ucrt)。 Ideally, your project should derive its IncludePath from the IncludePath set by the built-in Visual C++ targets that we provide with Visual Studio. 理想情况下,您的项目应从Visual Studio提供的内置Visual C ++目标的IncludePath集合派生其IncludePath。 If you do that, then this header would be picked up automatically. 如果您这样做,那么该标头将自动被拾取。 If you choose not to do this, you'll need to add this directory to your IncludePath (preferably by adding $(UniversalCRT_IncludePath) 如果选择不这样做,则需要将此目录添加到IncludePath中(最好通过添加$(UniversalCRT_IncludePath)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM