Please improve error message for linker fail due to missing module dependency

I have been burned by this a bunch and it wastes a lot of time.

Say I wrote some code in my Gameplay Module named GM, and unknowingly, used some code that lives in Other Module OM.

OM is currently not listed as a dependency of GM, so when I try to build GM, I get a linker error. Linker errors are hard to read, and in general as a C++ programmer I’ve learned to troubleshoot them in a certain way specific to typical C++ build chains. But now in Unreal Build Tool land, there is a whole new source for these errors, so I also have to remember that linker errors can be due to improper dependencies…

SO!! Please, if you could make the error message for a linker fail related to missing module dependency better, something like

“Perhaps you need to add module X as a dependency of module Y”

to at least remind me to check for this situation, that would be AWESOME.

Thanks <3

Hi ,

I have run into this error many times myself, so I understand your frustration. I have entered a feature request to investigate improving the error message in these cases (UE-12175).

You’re a great dude , thanks for looking out for us folks in the build trenches

Hi ,

Just a quick update here. Unfortunately we are not able to improve this particular error message, since it is one generated by Visual Studio’s C++ linker itself and not one of our tools. The only way we would be able to improve on this error message would be to implement our own custom compiler.

Cool, thanks for looking into it . Is there an overview of the build toolchain in UE4? It would be good to have documentation of what steps are under Epic’s control, what data they have access to, and what is solely up to the platform compile toolchain.

I’m wondering if there is a step in the toolchain that could look at the output of the VS linker and generate more detailed errors? Maybe that would be more of a hack than it is worth, maybe not.

Long story short, UnrealBuildTool generates command lines for the platform specific compiler and linker, it can also generate build jobs for XGE and other third party build solutions. It does not compile anything on its own. I guess the major difference between working with UBT and dependencies is that instead of setting them in Visual Studio project properties, you’re setting them in build.cs files. But generally both cases require some sort of manual set up.

More info about UBT can be found >here<](Using the Unreal Engine Build Pipeline | Unreal Engine 5.1 Documentation)

Parsing output wouldn’t help much IMO, unless UBT somehow knew where all the classes live in source code, which is way beyond what it is supposed to know :slight_smile:

Someone on my team had a great idea that if we put all classes inside of a module in namespace unique to that module, it would make it easy to say which dependency you’re missing, but again, this is something that’s not going to happen any time soon.