Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

DrMol

Need help with LNK2001 error..thanks!

This topic is 5760 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!