|
From: <dan...@ya...> - 2000-12-13 21:17:45
|
> Everything is working perfectly with C functions, but not with C++ > classes. > There are two problems: > 1) it is hard to decipher the name mangling of Microsoft's compiler > (especially for overloaded functions) > 2) I need to export the virtual table > It seems possible to export/import the virtual table but I'm > wondering > if the virtual table would be managed by the gnu compiler in way > compatible with the MS Visual C++ compiler. > > What do you think ? > Do I have to give up ? > > Marcello > Hello Marcello This is from the g++ FAQs "Why can't I link g++-compiled programs against libraries compiled by some other C++ compiler?" "Some people think that, if only the FSF and Cygnus Support folks would stop being stubborn and mangle names the same way that, say, cfront does, then any g++-compiled program would link successfully against any cfront-compiled library and vice versa. Name mangling is the least of the problems. Compilers differ as to how objects are laid out, how multiple inheritance is implemented, how virtual function calls are handled, and so on, so if the name mangling were made the same, your programs would link against libraries provided from other compilers but then crash when run. For this reason, the ARM encourages compiler writers to make their name mangling different from that of other compilers for the same platform. Incompatible libraries are then detected at link time, rather than at run time. " I believe there is a movement to standardise some of the C++ ABI issues and that G++ developers, particularly Jason Merrill, are involved in this movement. See here: http://reality.sgi.com/dehnert_engr/cxx/cxx-summary.html In the future, you may be able to do what you have suggested with the Bltz++ lib. But not yet. Cheers danny _____________________________________________________________________________ http://clubs.yahoo.com.au - Yahoo! Clubs - Join a club or build your own! |