"Could not find code file" when opening C++ class

I have been studying the ShooterGame sample provided by epic, and when I attempt to open any C++ class from within the browser, I receive a “Could not find code file” error. I just downloaded Visual Studio. Is there something that I haven’t done

or have done incorrectly?

1 Like

Try Generate Visual Studio 2017 Project in
File → Generate Visual Studio 2017 Project .

5 Likes

Hey there, first of all make sure you’ve installed Visual Studio with the necessary libraries (you can check that here). After that right click on your uproject and do Generate Visual Studio project files.

He seems to be having some permission errors, do you have administrator privileges?

I did and received this error message:

An error occurred while trying to generate project files.

Running C:/Program Files/Epic Games/UE_4.18/Engine/Binaries/DotNET/UnrealBuildTool.exe -projectfiles -project=“C:/Users/xamid/Documents/Unreal Projects/ShooterGame/ShooterGame.uproject” -game -rocket -progress
ERROR: UnrealBuildTool Exception: System.UnauthorizedAccessException: Access to the path ‘C:\Program Files\Epic Games\UE_4.18\Engine\Saved\UnrealBuildTool’ is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
at UnrealBuildTool.XmlConfig.CreateDefaultConfigFile(FileReference Location)
at UnrealBuildTool.XmlConfig.FindInputFiles()
at UnrealBuildTool.XmlConfig.ReadConfigFiles()
at UnrealBuildTool.UnrealBuildTool.GuardedMain(String[] Arguments)

I have administrator privileges, I reinstalled Visual Studio, still get the error

That’s weird because he’s complaining about unauthorized accesss. See if this or this works.

This worked for me, thanks!

Make sure your VS installation has C++ components.

Also ensure you have generated the project files by right clicking the .uproject.

Try to run as Administrator as well.

If that doesn’t work, try to manually open VS from UE by going to file->Open Visual Studio. And manually navigate to the file.

“ShooterGame sample provided by Epic” with that content displayed on the attached image? Wow. Can you share that link? Many thx.

In the Epic Games Launcher in the Unreal Engine section in the Learn tab under the Games header (scroll almost to the very bottom of the Learn tab) called Shooter Game.

Wow. there is some very cool stuff there. In the ShooterGame, try the semicolon key when in game mode. Thanks for that update.

Yes, its Work “Thankyou”