Linker error for non exported module

Linker errors even tho you have everything linked

If you get linker errors for a type and you've checked all the usual suspects (using UEngineCamerasSubsystem as an example)

is the module included in the build.cs

is the plugin activated in project settings (only needed for runtime only plugins but nonetheless)

#include is correct

Check that the module is actually exported

This was the case for UEngineCamerasSubsystem that the class I was trying to use didn't have a DLL export macro specified

Fix by adding DLL export macro

Find the name of the plugin from the module.cpp file (or build.cs file)

The macro will be the <name>_API so in this case ENGINECAMERAS_API which you can validate by either jumping to declaration in the generated code

Once you've added the DLL export macro you can freely use the type.

Note: you can also just export the functions or parts of the class you need rather than the entire class by adding the macro to them instead of the overall class

Last updated