Can't compile first C++ code

Hello,

I was following this video tutorial (Vid here)

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.

Sorry I don’t have the specific error messages yet. I’ll be able to send them when I get home in a few hours.

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.

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


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

LogVSAccessor: Warning: Couldn't access Visual Studio

Compiling game modules for hot reload
Performing full C++ include scan (no include cache file)
Parsing headers for FarmhouseTestEditor
  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
IfGeneratedCodeChanges
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'
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)).

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
ted.h.conflict’
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,

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

Turn off editor, since hot reload tend to be buggy try to make it work in normal way first without hot reload, open VS project file in your project directory it is sln file. Now considering you have “Changes to generated code are not allowed - conflicts written to” try rebuild, if that does not work delete “Intermediate” in your project folder. This should cause UHT to regenerate the code.

In VS2017 (which should work with UE4) installation check if you got VC++ toolchain and C++ core features, veryfy if you got cl.exe in location it points to.

Hi,
I did this and when I opened the sln it didn’t compile properly. A message read ‘one or more solution where not loaded correctly’. The output says:

C:\Users\User\Documents\Unreal Projects\FarmhouseTest\Intermediate\ProjectFiles\UE4.vcxproj : error : Project “C:\Users\User\Documents\Unreal Projects\FarmhouseTest\Intermediate\ProjectFiles\UE4.vcxproj” could not be found.

C:\Users\User\Documents\Unreal Projects\FarmhouseTest\Intermediate\ProjectFiles\FarmhouseTest.vcxproj : error : Project “C:\Users\User\Documents\Unreal Projects\FarmhouseTest\Intermediate\ProjectFiles\FarmhouseTest.vcxproj” could not be found.

Sorry for not responding in an age. But I got it working. I used this vid to remove all VS stuff from my machine an reinstalled VS with the needed expansions for C++ game coding and stuff. Unreal gives me an error when I create c++ files and attempt to open VS straight away. But when I build them in VS separately and open them from Unreal it all works as expected!