GetPrivateStaticClass() Unresolved External between Modules
I can't seem to call the "StaticClass" method on classes declared in other modules.
In IndependentModule, I declare ATestActor and ATestActor2:
In DependentModule, I add "IndependentModule" to the Public/PrivateDependency list. I then try to access the "StaticClass" methods of each class:
I get the following error: unresolved external symbol "__declspec(dllimport) private: static class UClass * __cdecl ATestActor2::GetPrivateStaticClass(void)" (__imp_?GetPrivateStaticClass@ATestActor2@@CAPEAVUClass@@XZ) referenced in function "public: void __cdecl UDependentComponent::TestFunction(void)" (?TestFunction@UDependentComponent@@QEAAXXZ)
I don't understand why this is failing on ATestActor2, but working on ATestActor. Additionally, if I change ATestActor to any other name, it fails. I have exposed the classes via the _API. The module is added to the appropriate Dependency list(s). What am I missing?
UPDATE: Several months later, I ran into a similar problem. After some testing in different contexts, the following conclusions are apparent:
Hence, the follow-up question is why? Is this aberrant behavior, caused by some missed lines/files somewhere? Otherwise, if this is expected behavior when linking updated game modules, I would like to know that, so that I can structure development to minimize lengthy Rebuilds.
Worked for me.
For me, the reason of issue was that old object files were in the "Intermediate" folder.
I faced the same issue, but the fix to my problem was to export the class.
For example in your case I forgot to add
answered Jan 09 '19 at 08:35 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here