Can't compile C++ code / Visual Studio Problem

Hello,

I was following this video tutorial (Vid here)](- YouTube)

and at the part I’ve linked to when I was attempting to compile my first C++ class I got an error. It said I needed to recompile my project to see my script in the contents folder. I reopened the project and nothing appeared. Also Visual Studio didn’t open. The .h and .cpp files appeared in the source folder but that was it. At the time I had Visual Studio Community 2017 installed. After some searching I found I needed to modify my installation and add the modules for C++ for Game Developing and some others to get this working. So I modified these things but it fixed nothing. (Actually this step fixed an issue that stopped my project from starting altogether after I did the first C++ class attempt). I uninstalled VS2017 and installed an old VS2015 but this didn’t fix anything. I feel like there’s a simple fix to this problem.

Here’s the red/yellow error code lines in the log. There’s more since I uninstalled VS and reinstalled and it says ‘couldn’t connect to Visual Studio’ there now.

  1. LogHttp: Warning: 0000022F1AF10880: request failed, libcurl error: 6 (Couldn’t resolve host name)

  2. ERROR: No 32-bit compiler toolchain found in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe

  3. LogVSAccessor: Warning: Couldn’t access Visual Studio

  4. Compiling game modules for hot reload

  5. Performing full C++ include scan (no include cache file)

  6. Parsing headers for FarmhouseTestEditor

  7. Running UnrealHeaderTool “C:\Users\User\Documents\Unreal Projects\FarmhouseTest\FarmhouseTest.uproject” “C:\Users\User\Documents\Unreal Projects\FarmhouseTest\Intermediate\Build\Win64\FarmhouseTestEditor\Development\FarmhouseTestEditor.uhtmanifest” -LogCmds=“loginit warning, logexit warning, logdatabase error” -Unattended -WarningsAsErrors -installed -Fail

  8. IfGeneratedCodeChanges

  9. ERROR: ‘C:/Users/User/Documents/Unreal Projects/FarmhouseTest/Intermediate/Build/Win64/UE4Editor/Inc/FarmhouseTest/MyCharacterBase.generated.h’: Changes to generated code are not allowed - conflicts written to ‘C:/Users/User/Documents/Unreal Projects/FarmhouseTest/Intermediate/Build/Win64/UE4Editor/Inc/FarmhouseTest/MyCharacterBase.generated.h.conflict’

  10. Error: UnrealHeaderTool failed for target ‘FarmhouseTestEditor’ (platform: Win64, module info: C:\Users\User\Documents\Unreal Projects\FarmhouseTest\Intermediate\Build\Win64\FarmhouseTestEditor\Development\FarmhouseTestEditor.uhtmanifest, exit code: OtherCompilationError (5)).

  11. CompilerResultsLog: ERROR: ‘C:/Users/User/Documents/Unreal Projects/FarmhouseTest/Intermediate/Build/Win64/UE4Editor/Inc/FarmhouseTest/MyCharacterBase.generated.h’: Changes to generated code are not allowed - conflicts written to 'C:/Users/User/Documents/Unreal Projects/FarmhouseTest/Intermediate/Build/Win64/UE4Editor/Inc/FarmhouseTest/MyCharacterBase.genera

  12. ted.h.conflict’

  13. CompilerResultsLog: Error: UnrealHeaderTool failed for target ‘FarmhouseTestEditor’ (platform: Win64, module info: C:\Users\User\Documents\Unreal Projects\FarmhouseTest\Intermediate\Build\Win64\FarmhouseTestEditor\Development\FarmhouseTestEditor.uhtmanifest,

  14. LogHttp: Warning: 0000022F3205C880: request failed, libcurl error: 6 (Couldn’t resolve host name)

Install Visual Studio 2017 with all the options for C++ development enabled in options of installer panel

**Run Unreal Engine as administrator solved for me. **

Create a shortcut for Unreal Engine in your desktop.


 **Right click > Properties > Advanced > Check 'Run as administrator'**
 

Hi Jack,
I’m sharing you my vsconfig file which might help you to look for these components in VS for installing. This one I exported from Visual Studio 2017