Unresolved external symbol - accessing Editor Mode static method
I'm trying to write an editor plugin that can resimulate all the ProceduralFoliageVolumes in the world context. To do this I'm using the following code, patterned after the implementation of FProceduralFoliageComponentDetails::OnResimulateClicked() in Editor/FoliageEdit/Private/ProceduralFoliageComponentDetails.h:
However, I keep getting the following error: error LNK2019: unresolved external symbol "public: static void __cdecl FEdModeFoliage::AddInstances(class UWorld *,class TArray const &)" (?AddInstances@FEdModeFoliage@@SAXPEAVUWorld@@AEBV?$TArray@UFDesiredFoliageInstance@@VFDefaultAllocator@@@@@Z) referenced in function "public: void __cdecl USpawnTool::ResimulateAll(void)" (?ResimulateAll@USpawnTool@@QEAAXXZ)
As far as I can tell, AddInstances isn't accessible for some reason, maybe because its header file (Editor/FoliageEdit/Private/FoliageEdMode.h) isn't part of the normal API. Is there a way I can make it accessible? I'd really like to use this function, and I'm not sure I can resimulate any volumes without it.
Here's a list of my includes if they'd be helpful: "Engine.h", "Editor.h", "SlateBasics.h"
"ProceduralFoliageSpawner.h", "ProceduralFoliageVolume.h", "ProceduralFoliageComponent.h", "FoliageType.h", "InstancedFoliage.h"
"Editor/UnrealEd/Public/EditorModes.h", "Editor/UnrealEd/Public/EditorComponents.h", "Editor/UnrealEd/Public/EdMode.h", "Editor/FoliageEdit/Private/FoliageEdMode.h", "Editor/PropertyEditor/Public/IDetailCustomization.h", "Editor/FoliageEdit/Private/ProceduralFoliageComponentDetails.h"
I figured it out. The class I was trying to access was not flagged for export, so I couldn't access from another class it through the API. I had to replace line 193 of FoliageEdMode.h with "class FOLIAGEEDIT_API FEdModeFoliage : public FEdMode" instead of "class FEdModeFoliage : public FEdMode". After that, I just recompiled the engine from source and it worked.
answered Jun 17 '16 at 11:57 PM
answered Jun 17 '16 at 06:07 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here