Could someone please help. Whenever I try to create a c++ class in a blueprint project or make a c++ project it says that it has failed to compile. I checked the output log when trying to create a c++ class and it says that visual studios cannot be accessed. could anyone shed some light on the situation?
Do you have VS properly installed? And are the correct permissions set for it?
Hello Liagon,
What year of Visual Studio are you using, such as 2012, 2013, 2015? Also, what type of install are you using? There are multiple types, such as using a Web install or Desktop. There are also other types such as Express, Community or Professional.
Are you able to compile base C++ projects outside of UE4?
Yes I’m pretty sure it’s installed properly. However I do not know what the correct permissions are?
I downloaded the 2013 community version and I chose the web installer format. I think that I can compile outside of UE4
Hello Liagon,
The “For Web” version is not compatible with UE4. You’ll need to install a desktop version to use Visual Studio with UE4. Please let me know if using the desktop version works for you.
I was referring to folder/file permissions (right-click > properties… ‘Security’ tab)… But it appears to be unrelated, considering you had the wrong install of VS. If you’re still having trouble, you can try checking these settings
Alright, thanks.
I’ve tried downloading the desktop version and setting all permissions to no avail. It still doesn’t compile anything to do with c++.
Let’s try this:
- Navigate to UE4 install folder (Defaults to
C:\Program Files\Epic Games\4.x\Engine\Binaries\WinYY
, wherex
is engine version andYY
is architecture type) - Right-click
UE4Editor.exe
and choose “Properties” - Click the Compatibility tab and choose “Run this program as administrator”
- Do the same thing for
UE4Game.exe
andUnrealCEFSubProcess.exe
- Navigate to DotNET folder (
4.x\Engine\Binaries\DotNET
) - Enable “Run as administrator” for
UnrealBuildTool.exe
- Navigate to VS install folder (Defaults to
C:\Program Files (x86)\Microsoft Visual Studio XX.0\VC\bin
) - Enable “Run as administrator” for
bscmake.exe
,cl.exe
,lib.exe
,link.exe
,ml.exe
,nmake.exe
andxdcmake.exe
- Navigate to IDE folder (
Visual Studio XX.0\Common7\IDE
) - Enable “Run as administrator” for
devenv.exe
Now double-click devenv.exe
to open VS. If a UAC prompt appears at any time, simply click “Yes” to grant permission & continue. Create a standard Win32 console project, or some kind of “Hello World” deal. Compile & run it. Did it work?
If that worked, then close VS and create a new UE4 C++ project. Did it work?
If not, post your output log. You can also try creating a UE4 Blueprint project, then close UE4, navigate to your project folder, right-click your *.uproject file and choose “Generate Visual Studio Project Files”. If that didn’t work, please post the output log for that as well.
However, If everything went as planned, you can slowly reverse the process of “Run as administrator”, unchecking the option for each file one by one, and trying to compile the project in-between to determine if it was indeed a permissions issue, and exactly which file(s) are causing it.
When you say “Navigate to Microsoft Visual Studios XX.0” I assumed that xx meant the version of Visual Studios. Although I appear to have three versions
9.0, 11.0 and 12.0. Which one do I choose, should I even have three?
You can find VS version history here:
Follow the steps for whichever version you are trying to use (preferably the latest).
Also, once you get things resolved, I would recommend taking a look at Setting Up Visual Studio for Unreal Engine | Unreal Engine Documentation
I have completed all the instructions on the link you have sent me and followed through your instructions above. However when I went to enable run as administrator for the devenv file it didn’t have a compatibility tab in its properties. I also found that when I enabled run as an administrator for the file in the UE4 engine I discovered that the editor doesn’t work.
When you said previously that the compiler doesn’t compile anything related to C++, does this include things unrelated to UE4, such as a basic C+±only project, or is it only to do with UE4 projects?
I thought it did but I tried again now and it doesn’t compile basic c++ projects either.
If you’re having issues with compiling basic C++ projects, this is most likely an issue inherent to Visual Studio itself. It would be best to contact Microsoft about this issue as they should be able to provide more support in this area. Unfortunately I’m not qualified to troubleshoot issues with Visual Studio itself unless it is in relation to compatibility with UE4.
Alright, thankyou for you’re help.