Need help with LNK2001 error..thanks!

Started by
1 comment, last by DrMol 21 years, 7 months ago
Ok, I have a file ArrayPtrControl.h and it''s cpp file, ArrayPtrControl.cpp I try to compile and I get unresovled external symbol on class ArrayPtrCtrl detructor and constructor. Here is the code. Segment of class definition //////////////////////////////////////////////////////// template< class NTYPE > class ArrayPtrCtrl { public: ArrayPtrCtrl( ); ~ArrayPtrCtrl( ); ... }; ////////////////////////////////////////////// Start of source file /////////////////////////////////////////////////////// template< class NTYPE > ArrayPtrCtrl< NTYPE >::ArrayPtrCtrl( ) : Start( NULL ), End( NULL ) { ... }; template< class NTYPE > ArrayPtrCtrl< NTYPE >::~ArrayPtrCtrl( ) { ... } This is the first time I am really messing about with templates. Can anyone see a problem with this? Thanks a lot, BTW how do you use the edit box? thanks again.
Advertisement
Just a thought. You are aware that the declaration and definition of a template must be in the same translation unit, right?

If that''s the problem, you can still split them up by (if you''re using VC6), excluding the cpp file from the build and including it in the header, provided you have inclusion guards.

Otherwise, I dunno.

Peace,
ZE.

//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links

[twitter]warrenm[/twitter]

hehe. Thanks a lot.

This topic is closed to new replies.

Advertisement