2016-05-01 36 views
0

今日、私はC++を学びたいと思っていました。 私は得続けるしかし、これらのエラー:Visual Studio C++で意図的にインクルードしていないヘッダーを開くことができない

を開けませんソースファイル「stdio.hの」
を開けませんソースファイル「TCHAR.H」
を開けませんソースファイル「SDKDDKver.h」

しかし、これらはデフォルトの空のWin32コンソールプロジェクトでも取得します。

これを修正する方法を知っている人はいますか?

OS:Windowsの10

私のデフォルトのコードは次のようになります。

// HelloWorld.cpp : Defines the entry point for the console application. 
    // 

    #include "stdafx.h" 


    int main() 
    { 
     return 0; 
    } 

エラーは以下のとおりです。出力ウィンドウに

Severity Code Description Project File Line Suppression State 
Error (active)  cannot open source file "stdio.h" HelloWorld c:\Users\HP\Documents\Visual Studio 2015\Projects\HelloWorld\HelloWorld\stdafx.h 10 

Severity Code Description Project File Line Suppression State 
Error (active)  cannot open source file "tchar.h" HelloWorld c:\Users\HP\Documents\Visual Studio 2015\Projects\HelloWorld\HelloWorld\stdafx.h 11 

Severity Code Description Project File Line Suppression State 
Error (active)  cannot open source file "SDKDDKVer.h" HelloWorld c:\Users\HP\Documents\Visual Studio 2015\Projects\HelloWorld\HelloWorld\targetver.h 8 

Severity Code Description Project File Line Suppression State 
Error (active)  cannot open source file "stdio.h" HelloWorld c:\Users\HP\Documents\Visual Studio 2015\Projects\HelloWorld\HelloWorld\stdafx.h 10 

1>------ Build started: Project: HelloWorld, Configuration: Debug Win32 ------ 
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\Win32\PlatformToolsets\v140\Toolset.targets(34,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". 
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== 

EDIT:

私はC++インストールしている私は
ファイル]> [新規]> [プロジェクト>のVisual C++
に行ったとき、最初の原因となることが唯一の私は「C++のために...インストール」表示されるでしょう、だから私はのいずれかをインストール信じます最初のオプション(それがどれだったかを覚えていない)とインストール後に私はプロジェクトを作成することができました。

+0

あなたが悪いを持っているように見えますVisual Studio 2015のインストール。 – drescherjm

+0

@drescherjmだから私はそれを再インストールする必要がありますか? – TheXReflex

+0

C++はデフォルトではインストールされません。カスタムインストールを行っていない場合は、アンインストールして再インストールする必要はなく、今度はC++を要求してください。インストール時にC++を選択したと思われる場合は、あなたの質問を編集してください。 –

答えて

0

stdafx.hの内容を確認してください。ヘッダーは一時的に含めることができます。特に、あなたが引用した3つのehadersは、新しいプロジェクトのためのVC++ stdafx.hにあります。 C++をプログラミングしている場合は、単純に削除することができます。

(これは、CおよびC++の間で選択するために、Microsoftの闘争について何かを言う:。。彼らはC99をサポートしていませんが、代わりにC++のCヘッダにデフォルトではないとしても<cstdio>

関連する問題