Same struct compile in one project and doesn't in another

Hello,

I have really strange problem with one of my projects: simple struct like this

    #include "TestStruct.generated.h"
    
    USTRUCT(BlueprintType)
    struct FTestStruct
    {
    	GENERATED_USTRUCT_BODY()
    };

is not properly compiled (generated header is not created by UTH), but I have tested that struct in another project and everything works fine.

Do you have any ideas what could be wrong?

Thanks in advance,
cloud

Please post the exact error you get so we can try and help out with more context

error C1083: Cannot open include file: ‘TestStruct.generated.h’: No such file or directory

Okay, the name of the generated .h file is based off of the .h file, not the structure inside it. So, if you have a file called “SimpleTypes.h” that contains FTestStruct, you need to include “SimpleTypes.generated.h”

Also, check to see if it’s actually generating anything for you, and what folder it’s generating in. ProjectName/Classes/TestStruct.h would probably be the right name in that case. The generated file should end up in an Intermediate directory off of your project directory, see if it actually makes something there. If it’s set up correctly, there should be lines in your compile log about running UnrealHeaderTool. If there are errors in that process, it won’t correctly generated the automated header