When creating a c++ project I can get around this issue by going in and manually setting the project’s directories to inherit - the project creation fails but it can then be opened with the .uproject file that was created.
It gets somewhat more unuseable when attempting to create c++ classes because it fails during linking with the log spitting out:
LINK: fatal error LNK1181: cannot open input file 'delayimp.lib'
After which the project appears to again lack directory inheritence when opened in VS2013. Once the directories for the project have been set to inherit from the parent again the VS project can be rebuilt then the unreal editor can be reloaded to reveal the new class built into it.
Restarting the editor every time I try to add a c++ class (and whatever may or may not be supposed to happen after adding the class through the editor - not really sure what that is as I’ve yet to see it) is very disruptive to my workflow. Is there any way to fix this? It seems like the invalid include/library/etc directories are baked into UE4 and getting reset after each change to the c++ codebase.
There are a few questions I’d like to ask for additional information:
- Which version of the engine are you working in?
- Are you using the binary version of the engine from the launcher or source code from GitHub?
- What is the error you receive when trying to create a C++ project?
First it was 4.7.4 then 4.7.5 - just finished reformatting and reinstalling UE4 and visual studio 2013 community so I’ll let you know if it’s still happening in a moment.
It looks like it was the build environment (I previously had a half dozen different versions of visual studio (professional 2010, some express versions, some bundled apps like vs.php and microcontroller programmers that had their own version of visual studio and the vs2013 community edition installed by UE4) in addition to about another half dozen compilers and linkers (gcc, mingw, etc) and SDKs for several versions of windows and every .net version.
I did notice that my global settings for default build profile (the one in the user directory) could be adjusted to include all the editor’s directories in the build profile and that would fix the project after right-clicking and hitting Generate Visual Studio project files, but would still crash while initially creating a project (could be opened after manually generating files) and would still fail when trying to add c++ classes (but i could regenerate after and build separately then restart the editor and they would appear).
Hope this information is helpful in correcting the issue for others - it might help if UE setup some working build configurations either explicitly whenever creating project files and/or in the default build settings. Sadly I’ll have to rebuild my build environment for everything else but a freshly formatted machine was able to get it working with UE4.
Am I correct in understanding that you were able to get things working in regards to creating projects and adding code to a project after the format/reinstall? It sounds as though the multiple VS versions and multiple compilers were causing problems when trying to establish which VS version/compiler to associate with a project or code. I will make sure to include the information you’ve provided in the current investigation for this problem. Since it sounds like the problem is fixed for you I am going to convert your comment into an answer, however if you have any other questions regarding this topic feel free to reopen this post.