UE_LOG defined in module not recognized in other files

I declare in my module. h and .cpp a new log category. I use extern to let the compiler know it’s a global new log category.

In my .h that extends IModuleInterface
DECLARE_LOG_CATEGORY_EXTERN(name…, … , … )

In my .cpp
DEFINE_LOG_CATEGORY(name…);

But I get this error in every single file I use UE_LOG(name… , etc)

‘FLogCategoryname…’: is not a class name or a namespace

I fixed this by including the module .h into all cpp files where I use the UE_LOG. But some of them still don’t work and it’s included.

I find this really suspicious and it doesn’t look right to include the module main file like this. Any ideas?

Said in the docs : If you create a category, you have to include the header file into every file that uses it (generally in cpp files instead of header files. You don’t usually see UE_LOGs in headers).

If it doesn’t work, then the problem could be that you are not using the proper name, the exact name of the category you created. This was my case, I forgot a letter in caps somewhere.

Thanks, I had the exact same problem (forgot a letter in caps in the middle of the log name). Took me a really long time to find that one out!