unresolved EmptyLinkFunctionForGeneratedCode

I’ve created a separate module within my game project and it’s been working fine for building and running in the editor on Win64. It’s even built and packaged properly on iOS, however when I try and package the project for Win64 or Android I’m getting a linker error:

UnrealBuildTool: UELinkerFixups.cpp.obj : error LNK2019: unresolved external symbol “void __cdecl EmptyLinkFunctionForGeneratedCodeMyModuleName(void)” (?EmptyLinkFunctionForGeneratedCodeMyModuleName@@YAXXZ) referenced in function “void __cdecl UELinkerFixups(void)” (?UELinkerFixups@@YAXXZ)

I’m unsure what setup I have that is incorrect. I see that the build process should probably be generating a generated.cpp for my module inside the Intermediate directory, but I don’t see one for my module.
Does anyone know what my problem could be?

Thanks!

Hello ,

What version of the editor are you using? Also, could you provide the entire log file from when your packaging fails? This can be found in your project’s directory under Saved > Logs. There could be some other messages that point toward what the issue is.

I’m using a source build based on 4.10 I’m looking at the log and it doesn’t really help narrow anything down. There are no other errors, just the linking errors due to that module’s autogenerated function.

Should every module get a .generated.cpp file? Could there be something not correct with my .Build.cs, Target.cs or .uproject file?

I cannot be sure without knowing more information. Even if you can’t find anything, the logs could still be helpful, as any information is at this point. Have you tried following the guidelines laid out here?

UHT should generate a generated .h but I’m not sure about a .cpp.

We haven’t heard from you in a while, . Are you still experiencing this issue? If so, have you tried checking what I mentioned in my previous comment? In the meantime, I’ll be marking this issue as resolved for tracking purposes. Whenever you’re available, please leave a comment and the question will reopen.

I meet same issue after upgrade from 4.11.2 to 4.12.3.
Just clean and build again in visual studio, it works.