Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old December 6th, 2006, 09:55 AM
Neo
Guest
 
Posts: n/a
Default Need help on this error

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

  #2  
Old December 6th, 2006, 10:25 AM
eriwik@student.chalmers.se
Guest
 
Posts: n/a
Default Re: Need help on this error

On Dec 6, 11:14 am, "Neo" <zingafri...@yahoo.comwrote:
Quote:
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 Wikström

  #3  
Old December 6th, 2006, 11:05 AM
bogdan
Guest
 
Posts: n/a
Default Re: Need help on this error


"""Neo ÐÉÓÁÌ(Á):
"""
Quote:
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

  #4  
Old December 6th, 2006, 11:05 AM
bogdan
Guest
 
Posts: n/a
Default Re: Need help on this error


"""Neo ÐÉÓÁÌ(Á):
"""
Quote:
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

  #5  
Old December 6th, 2006, 03:55 PM
Howard
Guest
 
Posts: n/a
Default Re: Need help on this error


"bogdan" <bogdan@birulevo.netwrote in message
news:1165404422.778098.278060@16g2000cwy.googlegro ups.com...
If you've got something to say, say it. I'm not about to click on an
unknown link.


  #6  
Old December 7th, 2006, 02:25 AM
Neo
Guest
 
Posts: n/a
Default Re: Need help on this error

Are you trying to instanciate C? You can't instanciate classes with
Quote:
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 Wikström
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.

  #7  
Old December 7th, 2006, 04:45 PM
Howard
Guest
 
Posts: n/a
Default Re: Need help on this error


"Neo" <zingafriend@yahoo.comwrote in message
news:1165459429.092924.64470@79g2000cws.googlegrou ps.com...
Quote:
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
Quote:
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


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles