Why can i not compile anymore in 4.9.2

i don’t want to be negative but its freaking me out…
Since 4.9 i was not able to compile my 4.8 seemed that unrealheadertool didn’t work properly as it gave me errors for Unreal Code Parts like USTRUCT UCLASS etc…
After some days i decided to start up from scratch Nr. 12 since 4.2 i missed out the c++ part as the code was not compatible to 4.9 or i didn’t get to manage it.
Now, suddenly i have compile errors again with nearly 0% c++ code… only some basic stuff like the projectbuild.cs
Its only the part unreal generates by using the class generator…

2>  SnowballCharacter_Player.cpp
2>I:\Entwicklung\Developed Games\SnowballPVP\branches\4.9\Intermediate\Build\Win64\UE4Editor\Inc\SnowballPVP\SnowballCharacter.generated.h(16): error C2007: #define-Syntax
2>I:\Entwicklung\Developed Games\SnowballPVP\branches\4.9\Intermediate\Build\Win64\UE4Editor\Inc\SnowballPVP\SnowballCharacter.generated.h(17): error C2007: #define-Syntax
2>I:\Entwicklung\Developed Games\SnowballPVP\branches\4.9\Intermediate\Build\Win64\UE4Editor\Inc\SnowballPVP\SnowballCharacter.generated.h(18): error C2007: #define-Syntax
2>I:\Entwicklung\Developed Games\SnowballPVP\branches\4.9\Intermediate\Build\Win64\UE4Editor\Inc\SnowballPVP\SnowballCharacter.generated.h(29): error C2007: #define-Syntax

please tell me whats wrong here?
i removed the intermediate folder and rebuild the vs studio files, i switched the configurations and was able to build with the development setting for a short time, actuallyim unable to build anything…by changing nothing…
i have to tell that our team is using svn for collaboration

please help me its no fun anymore :frowning:

after removing the parts UE Header Tool created for me,

and after removing the plugin AdvancedSessions it compiles…

See this thread for that:

where is the difference between 4.8 and 4.9? i only have those compiling problems since the release of 4.9

im developing with visual studio 2015 under windows 10

Hi ,

I am going to take a closer look at this tomorrow. I just wanted to confirm that without the AdvancedSessions plugin, everything works fine?

Also, just to make sure you are aware, Visual Studio 2015 support in 4.9 is still considered experimental. It should work, but has the potential to cause problems.

Hey ,
Thank you so much for looking into this!

Well actually it works without AdvancedSessions Plugin but compiling my code which worked without problems in 4.8 and earlier gives me also #define errors.

Your tip about VS 2015 is something i will try out!

I could give you the SVN Data of our team server so you can sync the project to look into that if you need to, just tell me!

Thank you very much!

Ok i installed VS 2013, removed VS 2015 before but still the same:

link text

I ran some experiments with the Advanced Sessions plugin today, and the only time I ran into any problems was when I created a project in 4.8 and added the 4.8 version of the plugin, then upgraded that project to 4.9 and did not also use the upgraded version of the plugin. The errors that I saw were different from the ones that you listed, though. I have a couple questions that should help clarify some things.

  • Does this only happen in the project that you upgraded from 4.8? If you create a brand new 4.9 project and add the 4.9 Advanced Sessions plugin, do you see the same errors?
  • When you upgraded your project to 4.9, did you remove the 4.8 Advanced Sessions plugin and replace it with the 4.9 Advanced Sessions plugin?

Hi ,
well since i was not able to upgrade my 4.8 project i started a 4.9 project from scratch, i used the 4.8 plugin in the 4.9 project while not 4.9.2 was released, when 4.9.2 was released i downloaded the updated plugin and got these errors

i can not count how often i restarted from scratch :frowning:

if you want i can give you access to our SVN Team Server so you can look into this

Unfortunately we are not able to connect to source control servers outside of our internal network. If you are able to upload a zipped sample project to Dropbox or Google, I would be happy to take a look at it. If you need to provide the project privately, you can [send me a PM][1] on the forums.

Hi ,

Thank you for providing the sample project. I was able to use it to see the errors that you described. After spending quite a bit of time looking through code in Visual Studio to try to determine what was happening, it turns out the solution is actually quite a bit simpler.

Here is what was happening. As part of the build process, the Unreal Build Tool was creating several #define preprocessor instructions for some USTRUCTs in one of the files in the plugin. When it does this, UBT uses the project’s folder structure to create the identifier for the #define instructions. Normally, this works fine. However, in this case the name of the root folder for the project started with a digit (4.9). Identifiers in C++ cannot start with a digit, they must start with a letter (upper or lowercase) or an underscore. This results in the compile errors that you are seeing. When I renamed the root project folder so that it started with a letter, I was able to compile the project successfully.

Please follow these steps and let me know if it clears up the issue for you:

  1. Rename the root project folder so that it starts with a letter or underscore (in this case, both A4.9 and _4.9 should work fine).
  2. Right-click on the .uproject file and select the “Generate Visual Studio project files” option.
  3. Open the project in Visual Studio and build it.

awesome ,
im stunned that i didn’t notice this myself!
thank you so much for all your help!

My artist is seeing the same issue with UE 4.10 but that’s with the date in the folder structure “E:\MyGame\07.12.2015…”. Hopefully removing the date will fix the issue… waiting to hear back from him…

Life saver! This issue was driving me mad!
I spent hours recompiling/rebuild/hacking at C++ source files and getting nowhere.

After reading 's comment above — all I had to do was change my project folder from 045 to _045

c++ doesn`t allow to start definitions with digits

ther problem is your folder
I:\Entwicklung\Developed Games\SnowballPVP\branches\4.9\Intermediate -
“4.9” is a root project folder

unreal build tool use root folder as start point to generate c++ headers for further compilation.
so, change name of your project root folder and re-generate visual studio solution.

Thank you so much ! I got to the point where I had reinstalled Visual Studio twice and had no clue what to do, you are a lifesaver! (changed root project from 99th-street to Street)