CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2008
    Posts
    9

    Strange error, any help?

    Hello, Im trying to compile my program but I am getting this strange error, I have no idea what it means.

    release/POLevel.o:POLevel.cc.text+0x46b): undefined reference to `Derived:erived()'
    release/POLevel.o:POLevel.cc.text+0x484): undefined reference to `Derived::createLevel()'
    release/POLevel.o:POLevel.cc.text+0x86b): undefined reference to `Derived:erived()'
    release/POLevel.o:POLevel.cc.text+0x884): undefined reference to `Derived::createLevel()'

    This is the code I have:

    Code:
    	Derived object;
    	object.createLevel();

    My Header class looks like this:

    Code:
    class Derived: public POLevel
    {
    	public:
    		void createLevel();
    		Derived();
    }
    
    Derived::Derived()
    {	
    	return;
    }
    The Derived.cc file for the respective methods looks basically like this:

    Code:
    Derived::Derived()
    {	
    	return;
    }
    
    void createLevel()
    {
    }

    I have no idea why im getting the error, any help would be greatly appreciated.

  2. #2
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    Re: Strange error, any help?

    Did you forgot to compile and link Derived.cc?
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  3. #3
    Join Date
    Oct 2006
    Location
    Singapore
    Posts
    346

    Re: Strange error, any help?

    Derived source file does not include the Derived header file. I think that may be the reason.
    Believe in your Dreams, Work for what you Believe in.
    My thoughts? Angelo's Stuff
    Some fun things I've done: RayWatch, QuickFeed, ACSVParser

    @ngelo

  4. #4
    Join Date
    Apr 2008
    Posts
    9

    Re: Strange error, any help?

    In Derived.cc I have this at the top,
    I just missed the header include when i copied it.

    #include "Derived.h"

    I think everything is linked correctly?
    Im not too sure though.

  5. #5
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Strange error, any help?

    Please read this, and reformulate your sample so that others can actually compile the code:

    http://www.parashift.com/c++-faq-lit...t.html#faq-5.8

    This eliminates us trying to guess what you really have.

    Regards,

    Paul McKenzie

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured