Unresolved external symbol

did you set up VS correctly?
can you build other C++ projects?

I am trying to create a child of InstancedStaticMeshComponent and create a new AddInstanceInternal function with the same code as the original but I get the error when I try to build InstanceUpdateCmdBuffer.Edit(), I guess I am missing something because I am doing something really simple and failing. I tried to call this function through Super or to include the InstancedStaticMeshComponent.h but nothing works.

Thanks for any help.

Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2019	unresolved external symbol "public: void __cdecl FInstanceUpdateCmdBuffer::Edit(void)" (?Edit@FInstanceUpdateCmdBuffer@@QEAAXXZ) referenced in function "protected: int __cdecl UMyInstancedStaticMeshComponent::MyAddInstanceInternal(int,struct FInstancedStaticMeshInstanceData *,struct FTransform const &)" (?MyAddInstanceInternal@UMyInstancedStaticMeshComponent@@IEAAHHPEAUFInstancedStaticMeshInstanceData@@AEBUFTransform@@@Z)	SSAMS	G:\Unreal\Projects\SSAMS\Intermediate\ProjectFiles\MyInstancedStaticMeshComponent.cpp.obj	1

If I comment out the InstanceUpdateCmdBuffer.Edit() everything works fine and I am working with other c++ classes so I think that yes, but who knows maybe I missed a step or something

Found this in the class

// Command that can't be in-lined and should cause full buffer rebuild
	void Edit();
	void Reset();

But I don’t use inline in my function and pretty much do the same as in the parent class and other function that can be called not in-lined show the same error.

I did tried to add __declspec(noinline) to my function so it doesn’t seem to be a problem of inline… so now its only getting more confusing for me…

It kind of wierd indeed but i dont think it’s related to inline because it just changes way function is linked. If everything fails that simply means there no symbols in module linking to that function, it needs extern which usually hidden in MODULENAME_API. If thats the case then you can’t call that function outside of the Engine module, rendering system have not of things not exposed like that.

Still i can’t find reason on first glance, so i might be wrong issue may be somewhere else

Yeah by the looks of it you are right tough maybe there is a way to extend InstanceStaticMesh itself and call the function from it, but I have no clue how to change the pointer of the InstanceStaticMeshComponent to a custom InstanceStaticMesh so that’s beyond me (but now that I think about it that shouldn’t work either, meh).
Tough I did found a work around, if you call any function that already have InstanceUpdateCmdBuffer.Edit() in them it works fine and dandy, so my work around is simple update the transform of one of the instance to its own transform, yes that is less efficient but at least it works.

I faced the same problem, and the easiest is to simply copy+paste the body function (Edit)… which translate to:
InstanceUpdateCmdBuffer.NumEdits++;