taco

...
Error 2 error LNK2019: unresolved external symbol "public: void __thiscall Graphics::Primitive<struct ColorVertex>::AddIndex(unsigned short)" (?AddIndex@?$Primitive@UColorVertex@@@Graphics@@QAEXG@Z) referenced in function "bool __cdecl MainLoad(void)" (?MainLoad@@YA_NXZ) D:\UGE\UGE\UGE.obj
...

And 5 other linker errors, caused by the same kind of problem.

I suspect that this might be caused by a way I declared
Graphics::Primitive<ColorVertex>::AddIndex()

1
2
3
4
5
6
template<typename TVertex>
void Primitive<TVertex>::AddIndex(ushort pIndex)
{
	index[indexCount] = pIndex;
	++indexCount;
}


But are there other possibilities?
Last edited on
Is that function body in the header file?

If not, it needs to be.
Why? It's prototyped in there?

edit:
I just witnessed something that my mind does not comprehend, at all...
Last edited on
One more question:
How do I contain dynamic memory within a class? Wait, is that possible, in any shape or form?
templated functions are the prototype including their body. The compiler resolves such functions when they're used. In the cpp-file they are 'out of sight' hence unresolved

Viblicent wrote:
How do I contain dynamic memory within a class? Wait, is that possible, in any shape or form?
sure in any shape or form.
Topic archived. No new replies allowed.