Can't compile C++ script

I can’t compile C++ scipts and additionally my project can’t be opened after create scipt. I get this message when I create new C++ file

96965-1.png

and when I want open once again my project I get this message

96964-2.png

When I confirm this I wait few secunds and rebuild failed.

Here are logs from editor when I create new C++ file:

Running C:/Program Files (x86)/Epic Games/4.12/Engine/Binaries/DotNET/UnrealBuildTool.exe  -projectfiles -project="C:/Users/patryk/Documents/Unreal Projects/MyProject5/MyProject5.uproject" -game -rocket -progress
Discovering modules, targets and source code for project...
LogHotReload: Recompiling module MyProject5...
LogVSAccessor:Warning: Couldn't access Visual Studio
Recompiling MyProject5...
Launching UnrealBuildTool... [C:/Program Files (x86)/Epic Games/4.12/Engine/Binaries/DotNET/UnrealBuildTool.exe MyProject5 -Module MyProject5 Win64 Development -editorrecompile -canskiplink "C:/Users/patryk/Documents/Unreal Projects/MyProject5/MyProject5.uproject"  -2015]
Performing full C++ include scan (hot reloading a new target)
Creating makefile for hot reloading MyProject5 (no existing makefile)
Compiling game modules for hot reload
Performing 6 actions (4 in parallel)
[3/6] Resource ModuleVersionResource.rc.inl
[2/6] Resource PCLaunch.rc
PCH.MyProject5.h.cpp
MyClass.cpp
MyProject5.cpp
C:\Users\patryk\Documents\Unreal Projects\MyProject5\Source\MyProject5\MyProject5.cpp: error C4599: '/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE': command line argument number 260 does not match precompiled header
C:\Users\patryk\Documents\Unreal Projects\MyProject5\Source\MyProject5\MyClass.cpp: error C4599: '/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE': command line argument number 260 does not match precompiled header
ERROR: UBT ERROR: Failed to produce item: C:\Users\patryk\Documents\Unreal Projects\MyProject5\Binaries\Win64\UE4Editor-MyProject5.dll
Total build time: 62,73 seconds
CompilerResultsLog: New page: Compilation - Jul 3, 2016, 7:14:37 AM
CompilerResultsLog: Info Performing full C++ include scan (hot reloading a new target)
CompilerResultsLog: Info Creating makefile for hot reloading MyProject5 (no existing makefile)
CompilerResultsLog: Info Compiling game modules for hot reload
CompilerResultsLog: Info Performing 6 actions (4 in parallel)
CompilerResultsLog: Info [3/6] Resource ModuleVersionResource.rc.inl
CompilerResultsLog: Info [2/6] Resource PCLaunch.rc
CompilerResultsLog: Info PCH.MyProject5.h.cpp
CompilerResultsLog: Info MyClass.cpp
CompilerResultsLog: Info MyProject5.cpp
CompilerResultsLog: Info C:\Users\patryk\Documents\Unreal Projects\MyProject5\Source\MyProject5\MyProject5.cpp: error C4599: '/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE': command line argument number 260 does not match precompiled header
CompilerResultsLog: Info C:\Users\patryk\Documents\Unreal Projects\MyProject5\Source\MyProject5\MyClass.cpp: error C4599: '/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE': command line argument number 260 does not match precompiled header
CompilerResultsLog: Info ERROR: UBT ERROR: Failed to produce item: C:\Users\patryk\Documents\Unreal Projects\MyProject5\Binaries\Win64\UE4Editor-MyProject5.dll
CompilerResultsLog: Info Total build time: 62,73 seconds
LogMainFrame: MainFrame: Module compiling took 62.963 seconds

I finally solved this problem , i added new C++ class(eg:slate widget) instead of empty c++ class.

Officially tutorial told me that i should create empty c++ class. But this doesn’t works for me.

Hope this help for you .And tell me if this works.

Sorry for my careless , The correct way is delete “Saved , Intermediate" folder in you folder .Then add c++ class in your project.