I can't compile first code in C++ in Visual Studio!

Hi everyone !

I am stuck with a big problem. I am trying to code in C++ with UE4.2.1 (not the last release of the engine). So I created a new project using the basic code template. Next Visual Studio Express 2013 open and I compile without modifying anything in the code. But of course it doesn’t work and it shows me this :

Warning	1	warning : The selected culture 'fr_FR' is not available; falling back to 'en'	C:\Users\****\Documents\Unreal Projects\Platformer\Intermediate\ProjectFiles\LogTextLocalizationManager	Platformer
Error	2	error : System.Management.ManagementException: Invalid namespace	C:\Users\****\Documents\Unreal Projects\Platformer\Intermediate\ProjectFiles\EXEC	Platformer
Error	3	error MSB3073: The command ""C:\Program Files\Unreal Engine\4.2\Engine\Build\BatchFiles\Build.bat" Platformer Win64 Development "C:\Users\****\Documents\Unreal Projects\Platformer\Platformer.uproject" -rocket" exited with code -1.	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets	38	5	Platformer

I tried to use the DebugGame Editor and the Development compiling mode but it is always the same.
This is weird because I remember using the UE4.1 version and it worked very well ! But now with the 4.2 it is not working.

I tried to reinstall Visual Studio 2013 but noting happened.

Edit : I also tried to reinstall the engine (4.2.1) but same result !

Edit2 : I subscribe again to UE4 to get the 4.4 version. So now I have the last release but when I try to compile it is always the same error, even if I tried to reinstall it many times ! :confused: please help me !

I will be very glad if someone could help me !

Tank you !

PS : Sorry if I made some mistakes I am French.

Try this, right click on your .uproject file and make sure you have the correct engine version selected. Then right click on the file again and hit “Generate Visual Studio Project Files”

Thank you for answering me ! But it doesn’t work. I tried to generate the Visual Studio project files but it happened like if I did nothing. It still doesn’t want to compile and it throw me again all the same errors.

Did you try to completely rebuild your project in Visual Studio (Find your project solution in the solution explorer → right click your project → press ‘Rebuild’)?

Yes and the result is the same : it doesn’t compile !

Anybody has an other idea ? I upgraded to UE4 4.4.3 and it is still not working !

Hi AnonymeR77,

A couple things to check. First, does your username contain any special characters (eg. é)? If so, we do have an issue we are working on correcting where special characters in file paths can prevent projects from building successfully. Try creating a project in a location that does not contain any special characters (eg. C:\ProjectFolder).

Second, what version of Visual Studio Express are you using? Is it Visual Studio Express 2013 for Windows Desktop? That is the only Express version that will work with Unreal Engine 4.

Thank you !
I tried to put my my project in C:/, because I have a “é” character in my username. But it is the same error “Invalid namespace”. I also tried to create a new project in C:/ but same thing happened.
I am using Visual Studio Express 2013.

Thank you for helping me !

I just need to make sure you are using the correct version of Visual Studio Express 2013. Microsoft released several different versions of Express, and the only one that works with Unreal Engine 4 is the Windows Desktop version. Is that the version that you are using?

Yes it is the VS 2013 for Windows Desktop that I am using.

Could you please check the VS120COMNTOOLS environment variable on your computer (located at Control Panel\System and Security\System -> Advanced system settings -> Environment Variables). This should be pointing to the ..\Common7\Tools folder inside your Visual Studio installation.

I check and the VS120COMNTOOLS is pointing to :
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\

Thank you for helping me !

Could you provide the full output that you receive from Visual Studio when you try to build a project for the first time?

Here is the output when I try build the basic code template for the first time :

1>------ Build started: Project: CodeProject, Configuration: Development_Editor x64 ------
1>  Parsing headers for CodeProjectEditor
1>LogTextLocalizationManager : warning : The selected culture 'fr_FR' is not available; falling back to 'en'
1>  Reflection code generation finished for CodeProjectEditor and took 5,498
1>EXEC : error : System.Management.ManagementException: Invalid namespace
1>     at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
1>     at System.Management.ManagementScope.InitializeGuts(Object o)
1>     at System.Management.ManagementScope.Initialize()
1>     at System.Management.ManagementObjectSearcher.Initialize()
1>     at System.Management.ManagementObjectSearcher.Get()
1>     at UnrealBuildTool.LocalExecutor.ExecuteActions(List`1 Actions)
1>     at UnrealBuildTool.UnrealBuildTool.ExecuteActions(List`1 ActionsToExecute, String& ExecutorName)
1>     at UnrealBuildTool.UnrealBuildTool.RunUBT(String[] Arguments)
1>  Cumulative action seconds (4 processors): 0,00 building projects, 0,00 compiling, 0,00 creating app bundles, 0,00 generating debug info, 0,00 linking, 0,00 other
1>  UBT execution time: 16,98 seconds
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command ""C:\Program Files\Unreal Engine\4.4\Engine\Build\BatchFiles\Build.bat" CodeProjectEditor Win64 Development "C:\CodeProject\CodeProject.uproject" -rocket" exited with code -1.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Please ! If someone know what it is making me this error, help me to resolve it !

We believe that the issue that you are seeing is closely related to another issue a user experienced a little while ago. A fix for this should be available in version 4.5. Would you be able to download the 4.5 Preview available in the Launcher and see if you are able to build a code project?

I can’t believe it ! It worked !! Thank you so much for helping me !

How do you resolve it ?