How to fix the "Failed to compile newly created game module" error?

For some reason whenever I try to create a new a new c++ class, it says “Failed to compile newly created game module.” I’ve been trying different versions of Unreal so could that be the reason as to why I’m getting this strange error. Here’s what the output log says.

LogPlatformFile: Not using cached read wrapper
LogInit:Display: RandInit(-811193676) SRandInit(-811193674).
LogTaskGraph: Started task graph with 4 named threads and 5 total threads.
LogStats: Stats thread started at 0.508805
LogInit: Version: 4.11.2-2946394+++UE4+Release-4.11
LogInit: API Version: 2927265
LogInit: Compiled (64-bit): Apr 18 2016 02:18:46
LogInit: Compiled with Visual C++: 19.00.23026.00
LogInit: Build Configuration: Development
LogInit: Branch Name: ++UE4+Release-4.11
LogInit: Command line:  
LogInit: Base directory: C:/Program Files/Epic Games/UE_4.11/Engine/Binaries/Win64/
LogInit: Installed Engine Build: 1
LogInit: Using libcurl 7.41.0
LogInit:  - built for x86_64-pc-win32
LogInit:  - supports SSL with WinSSL
LogInit:  - other features:
LogInit:      CURL_VERSION_SSL
LogInit:      CURL_VERSION_IPV6
LogInit:      CURL_VERSION_ASYNCHDNS
LogInit:      CURL_VERSION_LARGEFILE
LogInit:      CURL_VERSION_IDN
LogInit:  CurlRequestOptions (configurable via config and command line):
LogInit:  - bVerifyPeer = true  - Libcurl will verify peer certificate
LogInit:  - bUseHttpProxy = false  - Libcurl will NOT use HTTP proxy
LogInit:  - bDontReuseConnections = false  - Libcurl will reuse connections
LogInit:  - CertBundlePath = nullptr  - Libcurl will use whatever was configured at build time.
LogInit: Presizing for max 16777216 objects, including 0 objects not considered by GC, pre-allocating 0 bytes for permanent pool.
LogInit: Object subsystem initialized
LogInit: Selected Device Profile: [Windows]
LogInit: Applying CVar settings loaded from the selected device profile: [Windows]
LogInit: Computer: BRANDON-PC
LogInit: User: Brandon
LogInit: CPU Page size=65536, Cores=2
LogInit: High frequency timer resolution =3.215371 MHz
LogMemory: Memory total: Physical=8.0GB (8GB approx)
LogMemory: Platform Memory Stats for Windows
LogMemory: Process Physical Memory: 313.65 MB used, 313.65 MB peak
LogMemory: Process Virtual Memory: 314.39 MB used, 314.39 MB peak
LogMemory: Physical Memory: 6300.08 MB used, 8175.43 MB total
LogMemory: Virtual Memory: 621.73 MB used, 8388608.00 MB total
LogTextLocalizationManager: No specific translations for ('en-US') exist, so ('en') translations will be used.
LogD3D11RHI: D3D11 adapters:
LogD3D11RHI:    0. 'AMD Radeon HD 6800 Series' (Feature Level 11_0)
LogD3D11RHI:       1011MB of dedicated video memory, 0MB of dedicated system memory, and 3831MB of shared system memory, 1 output[s]
LogD3D11RHI: Chosen D3D11 Adapter: 0
LogD3D11RHI: Creating new Direct3DDevice
LogD3D11RHI:     Adapter Name: AMD Radeon HD 6800 Series
LogD3D11RHI:   Driver Version: Unknown (internal Unknown)
LogD3D11RHI:      Driver Date: Unknown
LogRHI: Texture pool is 708 MB (70% of 1011 MB)
LogD3D11RHI: Async texture creation disabled: no driver support
LogShaderCompilers: Guid format shader working directory is -10 characters bigger than the processId version (../../../../../../Users/Brandon/Desktop/MyProject/Intermediate/Shaders/WorkingDirectory/6072/).
LogShaderCompilers: Cleaned the shader compiler working directory 'C:/Users/Brandon/AppData/Local/Temp/UnrealShaderWorkingDir/9A46E3FC432EF6C05A4DFA907A672813/'.
LogShaderCompilers:Display: Using Local Shader Compiler.
LogTemp:Display: Loaded TP AllDesktopTargetPlatform
LogTemp:Display: Loaded TP WindowsClientTargetPlatform
LogTemp:Display: Loaded TP WindowsNoEditorTargetPlatform
LogTemp:Display: Loaded TP WindowsServerTargetPlatform
LogTemp:Display: Loaded TP WindowsTargetPlatform
LogTemp:Display: Loaded TP AndroidTargetPlatform
LogTemp:Display: Loaded TP Android_ASTCTargetPlatform
LogTemp:Display: Loaded TP Android_ATCTargetPlatform
LogTemp:Display: Loaded TP Android_DXTTargetPlatform
LogTemp:Display: Loaded TP Android_ETC1TargetPlatform
LogTemp:Display: Loaded TP Android_ETC2TargetPlatform
LogTemp:Display: Loaded TP Android_MultiTargetPlatform
LogTemp:Display: Loaded TP Android_PVRTCTargetPlatform
LogTemp:Display: Loaded TP HTML5TargetPlatform
LogTemp:Display: Loaded TP IOSTargetPlatform
LogTemp:Display: Loaded TP TVOSTargetPlatform
LogTemp:Display: Loaded TP LinuxNoEditorTargetPlatform
LogTemp:Display: Loaded TP LinuxServerTargetPlatform
LogTemp:Display: Loaded TP LinuxTargetPlatform
LogTargetPlatformManager:Display: Building Assets For Windows
LogDerivedDataCache:Display: Max Cache Size: 512 MB
LogDerivedDataCache: Loaded boot cache 1.35s 46MB C:/Users/Brandon/AppData/Local/UnrealEngine/4.11/DerivedDataCache/Boot.ddc.
LogDerivedDataCache:Display: Loaded Boot cache: C:/Users/Brandon/AppData/Local/UnrealEngine/4.11/DerivedDataCache/Boot.ddc
LogDerivedDataCache: FDerivedDataBackendGraph:  Pak pak cache file ../../../../../../Users/Brandon/Desktop/MyProject/DerivedDataCache/DDC.ddp not found, will not use a pak cache.
LogDerivedDataCache: Unable to find inner node Pak for hierarchical cache Hierarchy.
LogDerivedDataCache: FDerivedDataBackendGraph:  CompressedPak pak cache file ../../../../../../Users/Brandon/Desktop/MyProject/DerivedDataCache/Compressed.ddp not found, will not use a pak cache.
LogDerivedDataCache: Unable to find inner node CompressedPak for hierarchical cache Hierarchy.
LogDerivedDataCache:Display: Pak cache opened for reading ../../../Engine/DerivedDataCache/Compressed.ddp.
LogDerivedDataCache: Using Local data cache path C:/Users/Brandon/AppData/Local/UnrealEngine/Common/DerivedDataCache: Writable
LogInit: Selected Device Profile: [Windows]
LogContentStreaming: Texture pool size is 0.00 MB
LogMaterial: Uniform references updated for custom material expression Custom.
LogMeshUtilities: No automatic mesh reduction module available
LogMeshUtilities: No automatic mesh merging module available
LogMeshUtilities: No distributed automatic mesh merging module available
LogUObjectArray: 27679 objects as part of root set at end of initial load.
LogUObjectAllocator: 5591592 out of 0 bytes used by permanent object pool.
LogUObjectArray: CloseDisregardForGC: 0/0 objects in disregard for GC pool
LogInit: WinSock: version 1.1 (2.2), MaxSocks=32767, MaxUdp=65467
LogSlate: SlateFontCache - WITH_FREETYPE: 1, WITH_HARFBUZZ: 1
LogSlate: SlateFontCache - WITH_FREETYPE: 1, WITH_HARFBUZZ: 1
LogStreaming:Warning: Failed to read file '../../../Engine/Content/Editor/Slate/Common/Selection_16x.png' error.
LogSlate: Could not find file for Slate resource: ../../../Engine/Content/Editor/Slate/Common/Selection_16x.png
LogStreaming:Warning: Failed to read file '../../../Engine/Content/Editor/Slate/Common/Selection_16x.png' error.
LogSlate: Could not find file for Slate resource: ../../../Engine/Content/Editor/Slate/Common/Selection_16x.png
LogStreaming:Warning: Failed to read file '../../../Engine/Content/Editor/Slate/Common/Selection_16x.png' error.
LogSlate: Could not find file for Slate resource: ../../../Engine/Content/Editor/Slate/Common/Selection_16x.png
LogUdpMessaging: Initializing bridge on interface 0.0.0.0:0 to multicast group 230.0.0.1:6666.
LogAssetRegistry: FAssetRegistry took 0.0202 seconds to start up
SourceControl: Info Source control is disabled
SourceControl: Info Source control is disabled
SourceControl: Info Source control is disabled
SourceControl: Info Source control is disabled
LogHMD: Failed to initialize OpenVR with code 108
LogEngine: Initializing Engine...
LogAIModule: Creating AISystem for world NewWorld
LogInit: XAudio2 using 'Speakers (Realtek High Definition Audio)' : 2 channels at 48 kHz using 32 bits per sample (channel mask 0x3)
LogInit: FAudioDevice initialized.
LogDerivedDataCache: Saved boot cache 0.03s 46MB C:/Users/Brandon/AppData/Local/UnrealEngine/4.11/DerivedDataCache/Boot.ddc.
LogInit: Texture streaming: Enabled
LogInit: Transaction tracking system initialized
BlueprintLog: New page: Editor Load
LocalizationService: Info Localization service is disabled
LogCook:Display: Max memory allowance for cook 8192mb
LogCook:Display: Mobile HDR setting 1
LogCook:Display: Done creating registry. It took  0.00s.
LogFileCache: Scanning file cache for directory 'C:/Users/Brandon/Desktop/MyProject/Content/' took 0.02s
SourceControl: Info Source control is disabled
Cmd: MAP LOAD FILE="../../../../../../Users/Brandon/Desktop/MyProject/Content/FirstPersonBP/Maps/FirstPersonExampleMap.umap" TEMPLATE=0 SHOWPROGRESS=1 FEATURELEVEL=3
LightingResults: New page: Lighting Build
MapCheck: New page: Map Check
LightingResults: New page: Lighting Build
LogAIModule: Creating AISystem for world FirstPersonExampleMap
LogEditorServer: Finished looking for orphan Actors (0.000 secs)
Cmd: MAP CHECKDEP NOCLEARLOG
MapCheck: Info Map check complete: 0 Error(s), 0 Warning(s), took 48.481ms to complete.
LogFileHelpers: Loading map 'FirstPersonExampleMap' took 8.909
LogCollectionManager: Loaded 0 collections in 0.001948 seconds
LogFileCache: Scanning file cache for directory 'C:/Users/Brandon/Desktop/MyProject/Saved/Collections/' took 0.01s
LogFileCache: Scanning file cache for directory 'C:/Users/Brandon/Desktop/MyProject/Content/Developers/Brandon/Collections/' took 0.00s
LogFileCache: Scanning file cache for directory 'C:/Users/Brandon/Desktop/MyProject/Content/Collections/' took 0.00s
LogCollectionManager: Rebuilt the GUID cache for 0 collections in 0.000003 seconds
LogContentBrowser: Native class hierarchy populated in 0.0090 seconds. Added 1979 classes and 343 folders.
LogStats: UGameplayTagsManager::ConstructGameplayTagTree: Construct from data asset -  0.000 s
LogStats: UGameplayTagsManager::ConstructGameplayTagTree: GameplayTagTreeChangedEvent.Broadcast -  0.000 s
LogContentBrowser: Native class hierarchy updated for 'GameplayTags' in 0.0006 seconds. Added 12 classes and 0 folders.
LogContentBrowser: Native class hierarchy updated for 'WidgetCarousel' in 0.0005 seconds. Added 0 classes and 0 folders.
LogContentBrowser: Native class hierarchy updated for 'SuperSearch' in 0.0004 seconds. Added 1 classes and 2 folders.
LogContentBrowser: Native class hierarchy updated for 'AddContentDialog' in 0.0006 seconds. Added 0 classes and 0 folders.
LogContentBrowser: Native class hierarchy updated for 'SceneOutliner' in 0.0004 seconds. Added 1 classes and 2 folders.
LogCrashTracker: Crashtracker disabled due to settings.
LogUObjectGlobals:Warning: Failed to find object 'Class None.'
LogContentBrowser: Native class hierarchy updated for 'HierarchicalLODOutliner' in 0.0004 seconds. Added 1 classes and 2 folders.
LogLoad: Full Startup: 139.76 seconds (BP compile: 0.78 seconds)
LogExternalProfiler: Found external profiler: VSPerf
LogExternalProfiler: Using external profiler: VSPerf
LogOcInput: OculusInput pre-init called
LogContentStreaming: Texture pool size now 700 MB
LogRenderer: Reallocating scene render targets to support 700x508 (Frame:2).
LogAssetRegistry: Asset discovery search completed in 33.3178 seconds
LogCollectionManager: Rebuilt the object cache for 0 collections in 0.000001 seconds (found 0 objects)
LogCollectionManager: Fixed up redirectors for 0 collections in 0.000166 seconds (updated 0 objects)
LogEditorViewport: Clicking on Actor (LMB): StaticMeshActor (Sphere)
Running C:/Program Files/Epic Games/UE_4.11/Engine/Binaries/DotNET/UnrealBuildTool.exe  -projectfiles -project="C:/Users/Brandon/Desktop/MyProject/MyProject.uproject" -game -progress -2015
Discovering modules, targets and source code for game...
LogHotReload: Recompiling module MyProject...
LogVSAccessor:Warning: Couldn't access Visual Studio
Recompiling MyProject...
Launching UnrealBuildTool... [C:/Program Files/Epic Games/UE_4.11/Engine/Binaries/DotNET/UnrealBuildTool.exe MyProject -Module MyProject Win64 Development -editorrecompile -canskiplink "C:/Users/Brandon/Desktop/MyProject/MyProject.uproject"  -2015]
Creating makefile for hot reloading MyProject (no existing makefile)
Compiling game modules for hot reload
Performing full C++ include scan (no include cache file)
Parsing headers for MyProjectEditor
  Running UnrealHeaderTool "C:\Users\Brandon\Desktop\MyProject\MyProject.uproject" "C:\Users\Brandon\Desktop\MyProject\Intermediate\Build\Win64\MyProjectEditor\Development\UnrealHeaderTool.manifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
Reflection code generated for MyProjectEditor in 8.9060267 seconds
Performing 7 actions (2 in parallel)
[2/7] Resource PCLaunch.rc
PCH.MyProject.h.cpp
[3/7] Resource ModuleVersionResource.rc.inl
MyProject.cpp
Spline_Sphere.cpp
C:\Users\Brandon\Desktop\MyProject\Source\MyProject\Spline_Sphere.cpp: error C4599: '/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE': command line argument number 248 does not match precompiled headerC:\Users\Brandon\Desktop\MyProject\Source\MyProject\MyProject.cpp: error C4599: '/IC:\Program Fil
es (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE': command line argument number 248 does not match precompiled header
MyProject.generated.cpp
C:\Users\Brandon\Desktop\MyProject\Intermediate\Build\Win64\UE4Editor\Inc\MyProject\MyProject.generated.cpp: error C4599: '/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE': command line argument number 248 does not match precompiled header
-------- End Detailed Actions Stats -----------------------------------------------------------
ERROR: UBT ERROR: Failed to produce item: C:\Users\Brandon\Desktop\MyProject\Binaries\Win64\UE4Editor-MyProject.dll
Total build time: 700.58 seconds
CompilerResultsLog: New page: Compilation - Oct 5, 2018, 5:51:34 PM
CompilerResultsLog: Info Creating makefile for hot reloading MyProject (no existing makefile)
CompilerResultsLog: Info Compiling game modules for hot reload
CompilerResultsLog: Info Performing full C++ include scan (no include cache file)
CompilerResultsLog: Info Parsing headers for MyProjectEditor
CompilerResultsLog: Info   Running UnrealHeaderTool "C:\Users\Brandon\Desktop\MyProject\MyProject.uproject" "C:\Users\Brandon\Desktop\MyProject\Intermediate\Build\Win64\MyProjectEditor\Development\UnrealHeaderTool.manifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -instal
led
CompilerResultsLog: Info Reflection code generated for MyProjectEditor in 8.9060267 seconds
CompilerResultsLog: Info Performing 7 actions (2 in parallel)
CompilerResultsLog: Info [2/7] Resource PCLaunch.rc
CompilerResultsLog: Info PCH.MyProject.h.cpp
CompilerResultsLog: Info [3/7] Resource ModuleVersionResource.rc.inl
CompilerResultsLog: Info MyProject.cpp
CompilerResultsLog: Info Spline_Sphere.cpp
CompilerResultsLog: Info C:\Users\Brandon\Desktop\MyProject\Source\MyProject\Spline_Sphere.cpp: error C4599: '/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE': command line argument number 248 does not match precompiled headerC:\Users\Brandon\Desktop\MyProject\Source\MyProject\MyProject.cpp: error
 C4599: '/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE': command line argument number 248 does not match precompiled header
CompilerResultsLog: Info 
CompilerResultsLog: Info MyProject.generated.cpp
CompilerResultsLog: Info C:\Users\Brandon\Desktop\MyProject\Intermediate\Build\Win64\UE4Editor\Inc\MyProject\MyProject.generated.cpp: error C4599: '/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE': command line argument number 248 does not match precompiled header
CompilerResultsLog: Info -------- End Detailed Actions Stats -----------------------------------------------------------
CompilerResultsLog: Info ERROR: UBT ERROR: Failed to produce item: C:\Users\Brandon\Desktop\MyProject\Binaries\Win64\UE4Editor-MyProject.dll
CompilerResultsLog: Info Total build time: 700.58 seconds
LogMainFrame: MainFrame: Module compiling took 701.778 seconds

I even uninstalled Visual Studio and reinstalled it and I still get this error. Does anyone know what’s going on?

have you install the component for game dev in visual studio?

I did and it still didn’t work. Are there any other components that need to be installed?