I can't compile projects in 4.2

Dear Everyone,

Is anyone else having trouble compiling projects into 4.2 ?

I have regenerated my .sln using the new 4.2 engine’s generate project files.

I have tried compiling and I get this error:


warning : .generated.inl files have been deprecated - please remove the associated #include from your code


So then I removed the .generated from each and every class .h file,

and I get the compile error


Expected .generated at top of [my first class]


soooo

then I restored to a previous version

and just removed the #include YourGameClasses.h from my YourGame.h


same error about .generated being deprecated


sooo

then I removed all the .generated from each class, and also removed the YourGameClasses.h from my YourGame.h

and the error:


expected .generated at top of [my first class]


Soooo

what I am I supposed to do to upgrade a 4.1.1 project to 4.2 and not get all these .generated errors?


My Folder Structure

I am not storing all the .h files in Public, I have folders for both the .h and the .cpp



```

Public
MyFolder1
  MyClass1.h
   MyClass1.cpp
MyFolder2
  MyClass2.h
  MyClass2.cpp
...

```

Hey , yea, I’m having similar issues however not exactly the same for my two plugins. I haven’t re-targeted my game quite yet because it’s dependent on those plugins and also I’m seeing a fair amount of people on the AnswerHub forums complaining on loosing all of their Input Action Bindings… For me, after taking care of removing the include …generated… in my plugins, that’s when I got a very undescriptive error about Microsoft.MakeFile.Target failing during the build.

Responding to you Stryker, and to post more info:

After making a new third person code project in 4.2 editor,

I can see that the .generated files still do exist at the top of every .h file in the new project!

So I don’t understand what the compiler is complaining about at all

because the .generated files are still there!


**Example .h From 4.2 Third Person Code Project**



```

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#pragma once

#include "GameFramework/SpringArmComponent.h"
**#include "ThirdPersonCode_4_2Character.generated.h"**

UCLASS(config=Game)
class AThirdPersonCode_4_2Character : public ACharacter
{
	GENERATED_UCLASS_BODY()


```

Huh, now that’s weird. I think they mentioned that this time around there is only supposed to be the warning but with the next release it will throw an error. But when it happened to me, the first error I got was because it interpreted that warning as an error and after seeing your issues, I’m really confused now.

BTW… on the issue I’m having currently, all I did was copy over the directories since you pretty much have to resort to manual for now and this is what I am getting… not sure what changed from 4.1.1. This one is a little different than the header issue but I’ll have to make sure I backup my game before re-targeting it.

EDIT: Okay, now this is weird and maybe its because the error I am now getting is masking the warnings but when I put the include “…generated” for my back, the warnings go away but I get a warning and error about having the include in the first place… hmmm…

@Stryker and to Epic,


**4.2 Release Notes Comment**

The release notes say this:



```

UnrealHeaderTool

- HeaderGroup keyword has been removed as well as all header group generated headers.
- Any UCLASS declarations using HeaderGroup keyword need to be fixed (keyword has to be removed).
- All #includes to HeaderGroupNameClasses.h generated headers in licensee code need to be removed otherwise code will not compile.


```




Based on that I tried removing **MyGameClasses.h** from **MyGame.h** (coming from the Beta here)

but still all the .generated errors persist....

Again, regarding 4.2 Template

Again, every single .h in the 4.2 3rd person code Template That I just compiled still has the .generated includes.

There’s also only 2 classes now in the 4.2 3rd person template

Specifically:


// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#pragma once

#include "GameFramework/SpringArmComponent.h"
#include "ThirdPersonCode_4_2Character.generated.h"

UCLASS(config=Game)
class AThirdPersonCode_4_2Character : public ACharacter
{
	GENERATED_UCLASS_BODY()


and


#pragma once

#include "ThirdPersonCode_4_2GameMode.generated.h"

UCLASS(minimalapi)
class AThirdPersonCode_4_2GameMode : public AGameMode
{
	GENERATED_UCLASS_BODY()

};


My own project obviously looks similar

but I simply cannot compile my project at all


**Reverting to 4.1.1 **

I am going to have to revert to 4.1.1 until someone from Epic addresses this thread.

Anyone else's commentary in this thread is welcome as well 

:)

Update:

A project I created in 4.1.1, created from Third Person Code Template, and the updated to 4.2 by regenerating the .sln , worked just fine on the first compile attempt, with no modifications made.

The only differences I know of between my uncompiling project and the one that just compiled are a lot of includes of various engine stuff (I got rid of KismetLibraryClasses as per compile error),

and then also my file structure itself, which has lots of folders

Thanks for the post ! I’ll stay tuned and keep an eye out. Now that you mentioned it as well above, I don’t know if I got rid of my "Header Group"Classes.h file. I gotta run but I’m going to try to investigate this further later and if I get any results back or any more clarity, I’ll keep you posted . Thanks buddy!

Hee hee!

Let me know how it goes for you!

From what I understand, and what has worked for me. Is you keep your generated.h files. But remove your generated.inl files (They are the ones that have been made deprecated). Also you can remove any reference to HeaderGroup in your UCLASS defines, and that means removing your <HeaderGroup>Classes.h. Which may mean you will need to re-add those .h files elsewhere to ensure clean compile. This is what worked for me, for anyone who runs into troubles.

oooooh

I see it now!

In MyGame.cpp

I had to make this change:


// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.

#include "Solus.h"
//#include "Solus.generated.inl"

DEFINE_LOG_CATEGORY(SolusLog)
DEFINE_LOG_CATEGORY(SolusInitLog)
DEFINE_LOG_CATEGORY(SolusLevelBPLog)
DEFINE_LOG_CATEGORY(SolusSaveSystemLog)

IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, Solus, "Solus" );

Thanks !

Unfortunately I am still getting like 300 compile errors about not being able to find classes :slight_smile:

Things have changed terms of what I need to include for different folder structure setups, will post more when I figure it out.

I started my project in 4.1 and about almost finish it but then I downloaded 4.2 and it won’t open it just crashed this is very disappointment I mean what is good for upgrade if they make your project crash.

Haha, fingers crossed bud… lol

Thanks for clarifying this up . I’m going to re-do my plugins here and see if this is no longer an issue… I think I aced both which is also what’s causing confusion on my end

The warning message surprisingly doesn’t stop the generation of the project. Unlike previous versions, that warning does not count as an error.

EDIT: Also I have noticed that you need to rebuild the entire solution if you wish to see the warnings again, since it doesn’t flag them as errors

What I’ve gathered is that it will throw a compile error in 4.3 though, so everyone needs to fix this now :slight_smile:

what was stopping my compiling, are changes to the rules of how folder/file structures need to be set up to work in 4.2

If anyone else has difficulties, please note you can add private include paths to your build.cs:


//Private Paths
PrivateIncludePaths.AddRange(new string] { 
	"Solus/SolusCore",
	"Solus/SolusSaveSystem",
	"Solus/SolusCharacter",
	"Solus/SolusPC"
	});

Okay, so far no go. I thought at first it was getting me farther but funny enough, it led me right back to my original warning including a new one that isn’t quite making sense. The one that is questionable is telling me a header file cannot be found however I’ve set the individual include paths under the NMake line under Project Properties. and if I start typing #include w/ quotes in the header, it shows up as recognized, not to mention the header is sitting in the same exact directory that it’s being referenced from which is really mindboggling. I’m confused, I even manually referenced the \Intermediate.…\Inc as a search path which is what I needed to do prior to 4.2 but no luck. I think I did it manually for 4.1 but for 4.1.1, I just copied the files over to my custom directory before building solution files which auto took care of this for me. I think I’m going to try to simply rebuild the solution files and this will help take me away from my mess but I want to know what’s really happening. I’ll fill you guys in if any of my attempts work but I’ll probably reach back out tomorrow. I’ve been up working for roughly 33+ hours straight working on my game and as much as I want to dig into 4.2, it’s getting hard to form thoughts and the text on my screen is starting to resemble a bad acid trip :stuck_out_tongue: haha

Anyways, thanks for the help guys and I’ll check in tomorrow and fill ya in. Take it easy!

Haha yea definitely time to rest :slight_smile:

I’ve learned to not code when I am tired, I just end up undoing it / redoing it / debugging it excessively the next day :slight_smile:

Lordy, having the same problem over here. SO… removing .generated.inl, and what’s next?

T_T

I’m about to post a thread on what I’ve learned finally getting Solus to compile in 4.2 :slight_smile:

Feel free to post your compile errors there and we can all pitch in

Haha… that’s why I’m glad I stopped when I did. It would’ve been a lot more to fix today… haha.

I’ll meet you over and continue this talk on the new thread you started.