Need help on this error

N

Neo

I have a setup like
class A {
virtual void func1()=0;
.....
}
class B {
virtual void func2()=0;
....
}
class C: public A, public B {
virtual void func1()=0;
virtual void func2()=0;
....
}

where below class C is "bidir_chan"

g++ -O3 -Wall -I. -I.. -I../../../include -L. -L.. -L../../../lib-linux
-o run.x bidir_chan.o addr_generator.o main.o -lsystemc -lm 2>&1 |
c++filt
bidir_chan.o:bidir_chan.cpp:(.rdata$_ZTV10bidir_chan[vtable for
bidir_chan]+0x20): undefined reference to `bidir_chan::~bidir_chan()'
bidir_chan.o:bidir_chan.cpp:(.rdata$_ZTV10bidir_chan[vtable for
bidir_chan]+0x24): undefined reference to `bidir_chan::~bidir_chan()'
bidir_chan.o:bidir_chan.cpp:(.rdata$_ZTV10bidir_chan[vtable for
bidir_chan]+0x50): undefined reference to `non-virtual thunk to
bidir_chan::~bidir_chan()'
bidir_chan.o:bidir_chan.cpp:(.rdata$_ZTV10bidir_chan[vtable for
bidir_chan]+0x54): undefined reference to `non-virtual thunk to
bidir_chan::~bidir_chan()'
collect2: ld returned 1 exit status
what is this THUNK thing? I am using cygwin g++ ver 3.4.4-2

thanks for any hep,
Neo
 
E

eriwik

I have a setup like
class A {
virtual void func1()=0;
....}

class B {
virtual void func2()=0;
...}

class C: public A, public B {
virtual void func1()=0;
virtual void func2()=0;
...

}
where below class C is "bidir_chan"

Are you trying to instanciate C? You can't instanciate classes with
pure virtual functions. Either remove the '=0' from the method
declarations in class C and later provide a definition, or create a new
class D deriving from C which implements func1() and func2().
 
B

bogdan

"""Neo ÐÉÓÁÌ(Á):
"""
I have a setup like
class A {
virtual void func1()=0;
....
}
class B {
virtual void func2()=0;
...
}
class C: public A, public B {
virtual void func1()=0;
virtual void func2()=0;
...
}

where below class C is "bidir_chan"

g++ -O3 -Wall -I. -I.. -I../../../include -L. -L.. -L../../../lib-linux
-o run.x bidir_chan.o addr_generator.o main.o -lsystemc -lm 2>&1 |
c++filt
bidir_chan.o:bidir_chan.cpp:(.rdata$_ZTV10bidir_chan[vtable for
bidir_chan]+0x20): undefined reference to `bidir_chan::~bidir_chan()'
bidir_chan.o:bidir_chan.cpp:(.rdata$_ZTV10bidir_chan[vtable for
bidir_chan]+0x24): undefined reference to `bidir_chan::~bidir_chan()'
bidir_chan.o:bidir_chan.cpp:(.rdata$_ZTV10bidir_chan[vtable for
bidir_chan]+0x50): undefined reference to `non-virtual thunk to
bidir_chan::~bidir_chan()'
bidir_chan.o:bidir_chan.cpp:(.rdata$_ZTV10bidir_chan[vtable for
bidir_chan]+0x54): undefined reference to `non-virtual thunk to
bidir_chan::~bidir_chan()'
collect2: ld returned 1 exit status
what is this THUNK thing? I am using cygwin g++ ver 3.4.4-2

thanks for any hep,
Neo


http://magegame.ru/?rf=626f6764616e
 
B

bogdan

"""Neo ÐÉÓÁÌ(Á):
"""
I have a setup like
class A {
virtual void func1()=0;
....
}
class B {
virtual void func2()=0;
...
}
class C: public A, public B {
virtual void func1()=0;
virtual void func2()=0;
...
}

where below class C is "bidir_chan"

g++ -O3 -Wall -I. -I.. -I../../../include -L. -L.. -L../../../lib-linux
-o run.x bidir_chan.o addr_generator.o main.o -lsystemc -lm 2>&1 |
c++filt
bidir_chan.o:bidir_chan.cpp:(.rdata$_ZTV10bidir_chan[vtable for
bidir_chan]+0x20): undefined reference to `bidir_chan::~bidir_chan()'
bidir_chan.o:bidir_chan.cpp:(.rdata$_ZTV10bidir_chan[vtable for
bidir_chan]+0x24): undefined reference to `bidir_chan::~bidir_chan()'
bidir_chan.o:bidir_chan.cpp:(.rdata$_ZTV10bidir_chan[vtable for
bidir_chan]+0x50): undefined reference to `non-virtual thunk to
bidir_chan::~bidir_chan()'
bidir_chan.o:bidir_chan.cpp:(.rdata$_ZTV10bidir_chan[vtable for
bidir_chan]+0x54): undefined reference to `non-virtual thunk to
bidir_chan::~bidir_chan()'
collect2: ld returned 1 exit status
what is this THUNK thing? I am using cygwin g++ ver 3.4.4-2

thanks for any hep,
Neo


http://magegame.ru/?rf=626f6764616e
 
N

Neo

Are you trying to instanciate C? You can't instanciate classes with
pure virtual functions. Either remove the '=0' from the method
declarations in class C and later provide a definition, or create a new
class D deriving from C which implements func1() and func2().

I am sorry, there is a correction, I have another class D(which is
bidir_chan) which implements those functions of class C and is inturn
instantiated.
 
H

Howard

Neo said:
Are you trying to instanciate C? You can't instanciate classes with
pure virtual functions. Either remove the '=0' from the method
declarations in class C and later provide a definition, or create a new
class D deriving from C which implements func1() and func2().
I am sorry, there is a correction, I have another class D(which is
bidir_chan) which implements those functions of class C and is inturn
instantiated.

If you're still having a problem, then show the actual code you're referring
to. We can't help you resolve the problem if we're only going by a vague
description.

-Howard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top