x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

Product Version: UE 4.18
Tags:
more ▼

asked Jan 17 '18 at 10:40 AM in C++ Programming

avatar image

Jack W Lewis
9 4 5 8

avatar image Jack W Lewis Jan 17 '18 at 07:47 PM

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)).
 
  
avatar image Jack W Lewis Jan 17 '18 at 07:48 PM
   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)
 
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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!

more ▼

answered Feb 02 '18 at 06:40 PM

avatar image

Jack W Lewis
9 4 5 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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.

more ▼

answered Jan 17 '18 at 09:22 PM

avatar image

Shadowriver
35.7k 926 168 1104

avatar image Jack W Lewis Jan 17 '18 at 11:48 PM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question