What's changed with linking in 4.4?

I’ve just synced my 4.3 fork of the engine with 4.4 and got it compiling. However, when it gets to the linker I get a ton of linker errors in my new AGameMode super class. This code compiles, links and ran in UE4.3, so I’m not sure what’s changed.

The class is defined like so:

UCLASS(config = Game, notplaceable, BlueprintType, Blueprintable, hidecategories = (Info, Rendering, MovementReplication, Replication, Actor))
class ENGINE_API ABaseGameMode : public AInfo
{
	GENERATED_UCLASS_BODY()

	/** Restart the game, by default travel to the current map */
	virtual void RestartGame();

The first method there is one of the first to throw a linker error. There’s 71 of them, here’s the first 3:

27>EnginePrivate.h.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ABaseGameMode::RestartGame(void)" (?RestartGame@ABaseGameMode@@UEAAXXZ)
27>EnginePrivate.h.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ABaseGameMode::ReturnToMainMenuHost(void)" (?ReturnToMainMenuHost@ABaseGameMode@@UEAAXXZ)
27>Module.Engine.5_of_30.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ABaseGameMode::ReturnToMainMenuHost(void)" (?ReturnToMainMenuHost@ABaseGameMode@@UEAAXXZ)

Been doing some reading on the Unreal Build Tool and will continue to do so, but I have no idea why it’s not linking this. There’s some config somewhere preventing it I assume.

How does this work, and how do I fix this?

Are you making these changes directly in the Engine module? If so… not a good idea. You should be creating your game mode classes in your own modules.

If this class is already in your own module, then ENGINE_API is wrong. It must be YOURMODULE_API instead.

You will probably also want to inherit from AGameMode, not AInfo.

Thanks for the feedback. This is an engine refactor, that’s why I mentioned it was a fork of 4.3. I’m packaging a pull request.

Assuming that your class actually has a definition for ReturnToMainMenuHost then this should work. Have you tried deleting the Intermediates directory and doing a full rebuild after upgrading?

I rebuilt the project files using the batch file, did a full solution clean and rebuild, but didn’t delete the intermediates directory. Didn’t realize it was necessary. Deleted, ran the batch, cleaned and rebuilding now.

Still failing to link in the same way. Anything else I should try?

Where are the implementations of ABaseGameMode::ReturnToMainMenuHost and ABaseGameMode::RestartGame located at?

Thanks, for some reason the merge deleted ABaseGameMode.cpp which was where it was supposed to be. I have no idea why. Git is a mystery. Restoring that file caused it to link without issues. Thanks again!