Unresolved Externals when adding custom PhysicsVolume

When I add code that inherits from ADefaultPhysicsVolume or APhysicsVolume, it creates unresolved externals in my custom APawn class constructor. My APawn class doesn’t reference any brush functions… removing the custom physics volume (that contains no code) fixes the compile:

1>HyperPhysicsVolume.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl ABrush::IsLevelBoundsRelevant(void)const " (?IsLevelBoundsRelevant@ABrush@@UEBA_NXZ)
1>ZachPlayground.generated.cpp.obj : error LNK2019: unresolved external symbol "public: virtual bool __cdecl ABrush::IsLevelBoundsRelevant(void)const " (?IsLevelBoundsRelevant@ABrush@@UEBA_NXZ) referenced in function "class UClass * __cdecl Z_Construct_UClass_ARobotPawn(void)" (?Z_Construct_UClass_ARobotPawn@@YAPEAVUClass@@XZ)
1>HyperPhysicsVolume.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ABrush::CheckForErrors(void)" (?CheckForErrors@ABrush@@UEAAXXZ)
1>ZachPlayground.generated.cpp.obj : error LNK2019: unresolved external symbol "public: virtual void __cdecl ABrush::CheckForErrors(void)" (?CheckForErrors@ABrush@@UEAAXXZ) referenced in function "class UClass * __cdecl Z_Construct_UClass_ARobotPawn(void)" (?Z_Construct_UClass_ARobotPawn@@YAPEAVUClass@@XZ)
1>HyperPhysicsVolume.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl ABrush::IsStaticBrush(void)const " (?IsStaticBrush@ABrush@@UEBA_NXZ)
1>ZachPlayground.generated.cpp.obj : error LNK2019: unresolved external symbol "public: virtual bool __cdecl ABrush::IsStaticBrush(void)const " (?IsStaticBrush@ABrush@@UEBA_NXZ) referenced in function "class UClass * __cdecl Z_Construct_UClass_ARobotPawn(void)" (?Z_Construct_UClass_ARobotPawn@@YAPEAVUClass@@XZ)
1>HyperPhysicsVolume.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ADefaultPhysicsVolume::Destroyed(void)" (?Destroyed@ADefaultPhysicsVolume@@UEAAXXZ)
1>ZachPlayground.generated.cpp.obj : error LNK2019: unresolved external symbol "public: virtual void __cdecl ADefaultPhysicsVolume::Destroyed(void)" (?Destroyed@ADefaultPhysicsVolume@@UEAAXXZ) referenced in function "void __cdecl GetPrivateStaticClassBody<class AHyperPhysicsVolume>(wchar_t const *,wchar_t const *,class UClass * &,void (__cdecl*)(void))" (??$GetPrivateStaticClassBody@VAHyperPhysicsVolume@@@@YAXPEB_W0AEAPEAVUClass@@P6AXXZ@Z)
1>D:\UnrealProjects\ZachPlayground\Binaries\Win64\UE4Editor-ZachPlayground-Win64-DebugGame.dll : fatal error LNK1120: 4 unresolved externals

Any idea on this one? having the same problem.

Sounds like a bug to me, maybe upvoting the question will get it more attention.

Hi hyperdrive,

I tried to reproduce this in 4.4.0 and received a different error message (which I will also need to investigate) when I tried building the project in Visual Studio. Would you be able to provide some more information to help me reproduce the issue that you are seeing?

  • What version of the Engine are you using, and are you using the binary version installed by the Launcher or did you build the Engine using source code?
  • Does this only happen for you in your project, or can you reproduce the issue in a brand new project from one of the templates?

I can repro this in the binary versions of 4.4.0 and 4.4.1 by creating a new project from the Basic Code (C++) template and adding a class that inherits from ADefaultPhysicsVolume or APhysicsVolume.

The errors read slightly different depending on which class you inherit from, but they’re both in the category of unresolved externals.

Hi ,

Thank you for the clarification. I was able to reproduce the issue with the additional information you provided. I have submitted a report about this to our development team to have it investigated further (TTP# 345281). Unfortunately I was not able to come up with a workaround for this.

I fixed this just now, CL 2283280. Some classes were missing some ENGINE_API exports (I just made ABrush, AVolume, and APhysics volume export everything).

I have encountered the same problem with most recent binary and git revisions

SaperPL can you post the link errors? Are they exactly the same? And can you verify that the Brush.h version you are using is declared as:

class ENGINE_API ABrush : public AActor

1>ShadowSneakingVolume.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl ABrush::IsLevelBoundsRelevant(void)const " (?IsLevelBoundsRelevant@ABrush@@UEBA_NXZ)
1>AITest.generated.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl ABrush::IsLevelBoundsRelevant(void)const " (?IsLevelBoundsRelevant@ABrush@@UEBA_NXZ)
1>ShadowSneakingVolume.cpp.obj : error LNK2001: unresolved external symbol “public: virtual void __cdecl ABrush::CheckForErrors(void)” (?CheckForErrors@ABrush@@UEAAXXZ)
1>AITest.generated.cpp.obj : error LNK2001: unresolved external symbol “public: virtual void __cdecl ABrush::CheckForErrors(void)” (?CheckForErrors@ABrush@@UEAAXXZ)
1>ShadowSneakingVolume.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl ABrush::IsStaticBrush(void)const " (?IsStaticBrush@ABrush@@UEBA_NXZ)
1>AITest.generated.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl ABrush::IsStaticBrush(void)const " (?IsStaticBrush@ABrush@@UEBA_NXZ)

Nope, there’s no ENGINE_API macro in the definition.

I got the same error on git version and latest launcher binary version(19$ indie version)

Just noticed that getting git version gives me 4.4 branch not master, I’ll investigate that.

OK, I’ve got the master branch with github gui - I just don’t get the git windows gui.

Finally I’ve got the same problem in 4.4.3 preview and couldn’t compile bleeding-edge from masters because of missing Half dll.

My fix only applies for git hub master, it hasn’t been rolled in to any patches for 4.4, and I’m told it can’t because it could break binary compatibility between plugins and modules. It will be present in 4.5.

Thanks for the info. Rather than this not working in 4.4 I’m more disappointed in github master beeing so bleeding edge it doesn’t compile out of box on main platform which is windows pc.

Do you remember what errors specifically you get from the master branch? Since it is bleeding edge (and there are a lot of people on the project), we occasionally do have check-ins that cause build errors that don’t get caught for a few hours sometimes, so it may have just been bad timing. But I want to be sure you’re not seeing something out of the norm that hasn’t been fixed.

It was just missing Half library and the other one from oculus. The oculus one I could fix by relocating the libs just as described on answerhub while fix for the Half was already applied and its project did compile properly but still main project couldn’t find the lib.

I’ll try again getting the newest bleeding edge.

EDIT: OK - It did compile now on bleeding edge but my whole AI made with blueprints somehow stopped working partially. Simple patrol tasks looks like they are working in debug view but character’s won’t move. I’ll just wait for the 4.5 release I think