By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,133 Members | 1,294 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,133 IT Pros & Developers. It's quick & easy.

Need help on this error

P: n/a
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_ch an[vtable for
bidir_chan]+0x20): undefined reference to `bidir_chan::~bidir_chan()'
bidir_chan.o:bidir_chan.cpp:(.rdata$_ZTV10bidir_ch an[vtable for
bidir_chan]+0x24): undefined reference to `bidir_chan::~bidir_chan()'
bidir_chan.o:bidir_chan.cpp:(.rdata$_ZTV10bidir_ch an[vtable for
bidir_chan]+0x50): undefined reference to `non-virtual thunk to
bidir_chan::~bidir_chan()'
bidir_chan.o:bidir_chan.cpp:(.rdata$_ZTV10bidir_ch an[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

Dec 6 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
On Dec 6, 11:14 am, "Neo" <zingafri...@yahoo.comwrote:
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().

--
Erik Wikstrm

Dec 6 '06 #2

P: n/a

"""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_ch an[vtable for
bidir_chan]+0x20): undefined reference to `bidir_chan::~bidir_chan()'
bidir_chan.o:bidir_chan.cpp:(.rdata$_ZTV10bidir_ch an[vtable for
bidir_chan]+0x24): undefined reference to `bidir_chan::~bidir_chan()'
bidir_chan.o:bidir_chan.cpp:(.rdata$_ZTV10bidir_ch an[vtable for
bidir_chan]+0x50): undefined reference to `non-virtual thunk to
bidir_chan::~bidir_chan()'
bidir_chan.o:bidir_chan.cpp:(.rdata$_ZTV10bidir_ch an[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

Dec 6 '06 #3

P: n/a

"""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_ch an[vtable for
bidir_chan]+0x20): undefined reference to `bidir_chan::~bidir_chan()'
bidir_chan.o:bidir_chan.cpp:(.rdata$_ZTV10bidir_ch an[vtable for
bidir_chan]+0x24): undefined reference to `bidir_chan::~bidir_chan()'
bidir_chan.o:bidir_chan.cpp:(.rdata$_ZTV10bidir_ch an[vtable for
bidir_chan]+0x50): undefined reference to `non-virtual thunk to
bidir_chan::~bidir_chan()'
bidir_chan.o:bidir_chan.cpp:(.rdata$_ZTV10bidir_ch an[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

Dec 6 '06 #4

P: n/a

"bogdan" <bo****@birulevo.netwrote in message
news:11**********************@16g2000cwy.googlegro ups.com...
>

http://magegame.ru/?rf=626f6764616e
If you've got something to say, say it. I'm not about to click on an
unknown link.
Dec 6 '06 #5

P: n/a
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().

--
Erik Wikstrm
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.

Dec 7 '06 #6

P: n/a

"Neo" <zi*********@yahoo.comwrote in message
news:11*********************@79g2000cws.googlegrou ps.com...
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().

--
Erik Wikstrvm
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
Dec 7 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.