derived class from wxWidgets can not compile in Linux

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
hongxing
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 227
Joined: Mon Aug 01, 2005 10:04 am

derived class from wxWidgets can not compile in Linux

Post by hongxing » Tue Aug 23, 2005 1:58 am

I derived class from wxGrid and wxTaskBarIcon, the project is normal in
windows compiling with VC6, but in SuSE Linux Enterprise Server 9, I got the following errors:
undefined reference to 'vtable for CMyGrid'

the compile errors point to the constructor and destructor function in the source file (.cpp).

urgent, thanks!

SnakeChomp
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 235
Joined: Sun Oct 10, 2004 2:53 am
Contact:

Post by SnakeChomp » Tue Aug 23, 2005 4:33 am

Why are you deriving from both wxGrid and wxTaskbarIcon? Do not use multiple inheritence when dealing with wxWidgets objects, for any reason what so ever.

hongxing
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 227
Joined: Mon Aug 01, 2005 10:04 am

oh no, I derived two class respectively

Post by hongxing » Tue Aug 23, 2005 6:10 am

CMyGrid and CMyTaskBarIcon

Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg » Tue Aug 23, 2005 6:11 am

SnakeChomp's comment still applies. You cannot inherit from two controls expecting to get both functionality in one class.

- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

upCASE
Site Admin
Site Admin
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE » Tue Aug 23, 2005 7:13 am

OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda

waterj
Earned a small fee
Earned a small fee
Posts: 21
Joined: Mon Nov 07, 2005 8:39 am

Post by waterj » Mon Jan 16, 2006 6:43 am

I think multiple inheritence would cause compiling errors. Maybe you should try checking and removong things like "#pragma interface"

Post Reply