Very peculiar issue (BP to CPP migration)

Greetings.
I’m having a VERY project-specific issue.

I’ve been using this project since 4.16 or so. And there were no any issues so far. Until I decided to add a C++ to it.
And that killed it.
I’m not even modified any files, just added an actor c++ class.

The issue was the name of the project, and my assumption it’s the reason it’s now could not be compiled at all.

The name is - NULL

*I can imagine your face now

Yet my issue is, I can’t find a way to rename it. I’ve tried to edit the class name, redirectors in INI etc. But I always get some errors. And there’s no guide for it, no explanation how do UE4 modules work.

I’ve never gone from a Blueprint only project to one including C++ so maybe post a little more about the error you’re running in to. Also, Check your .uproject file. By default a Blueprint only project won’t define any modules while a C++ project will have at least a single module defined. My gut say this is your problem. Also make sure you have xxx.Target.cs and xxxEditor.Target.cs defined and finally make sure your xxx.Build.cs file.

UE4 adds Game module when you add any C++ to the project.

My guess that’s the MACRO is behind this.

screenshot.1569261266.png

Yea, NULL is basically a reserved word for most platforms. Don’t name your game NULL. :slight_smile:

I was going to say… is your game called NULL? That’s going to wreck you :slight_smile: Maybe call it NULLGame instead.

Yeah, but. How to do that? It’s not like I can just change all mentions of “NULL” and it will magically start to work. I’ve tried that…
That’s why I’ve made this thread. I need information on how to rename a game module.

Rename the .uproject, rename .Build.cs, etc.

Honestly, I’d just create a new project with your new name and copy / paste over code / assets - and fix things up as things complain (Assets shouldn’t matter, but C++ will want new paths, etc). It’s probably an hour or two of “pain”, but then you’re done and you’ll preserve your old project just in case.

I still would like to know how to do that properly. Cause bruteforce is least appealing option.
And I found no explanation of how UBT treats project name, where it matters and where not.

So far i’ve solved the issue by adding:


#define NULL NULL

to main NULL.cpp