Click to See Complete Forum and Search --> : Strange error, any help?


Timb
May 16th, 2008, 02:13 AM
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::Derived()'
release/POLevel.o:POLevel.cc:(.text+0x484): undefined reference to `Derived::createLevel()'
release/POLevel.o:POLevel.cc:(.text+0x86b): undefined reference to `Derived::Derived()'
release/POLevel.o:POLevel.cc:(.text+0x884): undefined reference to `Derived::createLevel()'

This is the code I have:


Derived object;
object.createLevel();



My Header class looks like this:


class Derived: public POLevel
{
public:
void createLevel();
Derived();
}

Derived::Derived()
{
return;
}



The Derived.cc file for the respective methods looks basically like this:


Derived::Derived()
{
return;
}

void createLevel()
{
}



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

laserlight
May 16th, 2008, 02:15 AM
Did you forgot to compile and link Derived.cc?

angelorohit
May 16th, 2008, 02:16 AM
Derived source file does not include the Derived header file. I think that may be the reason.

Timb
May 16th, 2008, 02:18 AM
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.

Paul McKenzie
May 16th, 2008, 03:02 AM
Please read this, and reformulate your sample so that others can actually compile the code:

http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.8

This eliminates us trying to guess what you really have.

Regards,

Paul McKenzie