How do i define this function?

This is a discussion on How do i define this function? within the C++ Programming forums, part of the General Programming Boards category; I'm sure it's the syntax, but i just keep fidlin' wit it and it still won't work. it's an unresolved ...

  1. #1
    Registered User
    Join Date
    Sep 2004
    Posts
    719

    How do i define this function?

    I'm sure it's the syntax, but i just keep fidlin' wit it and it still won't work. it's an unresolved symbol error

    edit: it's all in the same file by the way

    Code:
    template<class _T>
    class BTree
    {
    	//Forward Declaration
    	public:
    	class iterator;
    	class in_iter;
    
    	//Typedefs
    	typedef _T * _Tpt;           // Template pointer type
    	typedef BTree<_T> _Bt;	     // BTree type	
    	typedef BTree<_T> * _Bpt;    // Btree pointer type
    	typedef iterator _ItB;       // Iterator type base
    
    	
    	public:
    	//Base class for all iterator types
    	class iterator
    	{
    		public:
    
    		_ItB operator=(const _Bpt);
    
    		protected:
    		_Bpt current;
    	};
    
    
    };
    
    
    template<typename _T> 
    BTree<_T>::_ItB   /* <-- return type | definition --> */
    BTree<_T>::iterator::operator=(const _Bpt srcTree)
    {
    	current = &srcTree;
    	return this;
    }

    Edit: this may help if the error is not as obvious as i hope for it to be


    Linking...
    main.obj : error LNK2001: unresolved external symbol "public: class BTree<int>::iterator __thiscall BTree<int>::iterator:perator=(class BTree<int> * const)" (??4iterator@?$BTree@H@@QAE?AV01@QAV1@@Z)
    Debug/btree02.exe : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.
    Last edited by misplaced; 04-06-2005 at 01:18 AM.
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  2. #2
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    well, i got the operator= to work in dev-c++. now i can't get
    _T operator*(void) to work!

    it's basically the same thing!
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. Help getting multiple keypresses in a DOS compiler
    By Nongan in forum Game Programming
    Replies: 2
    Last Post: 04-01-2005, 09:07 PM
  3. Directional Keys - Useing in Console
    By RoD in forum C++ Programming
    Replies: 38
    Last Post: 10-06-2002, 04:42 PM
  4. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 01:27 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21