Jump to content
  • Advertisement


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


Need help with LNK2001 error..thanks!

This topic is 5850 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
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.


//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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!