From: <dan...@ya...> - 2001-06-25 01:35:57
|
Another DLL problem with GCC-3.0 http://gcc.gnu.org/ml/gcc-bugs/2001-05/msg00877.html /////////////////////////////////////////////////////////////////////// class foo { public: foo (); void bar (); }; __attribute__((dllexport)) foo::foo() { } __attribute__((dllexport)) void foo::bar () { } /////////////////////////////////////////////////////////////////////// foo::bar() will be exported, foo::foo() won't. 2.95.3 and 2.95.3-1 export both. Danny _____________________________________________________________________________ http://messenger.yahoo.com.au - Yahoo! Messenger - Voice chat, mail alerts, stock quotes and favourite news and lots more! |
From: Mumit K. <khan@NanoTech.Wisc.EDU> - 2001-06-25 02:36:03
|
On Mon, 25 Jun 2001, Danny Smith wrote: > Another DLL problem with GCC-3.0 > > http://gcc.gnu.org/ml/gcc-bugs/2001-05/msg00877.html > > /////////////////////////////////////////////////////////////////////// > class foo > { > public: > foo (); > void bar (); > }; > > __attribute__((dllexport)) foo::foo() { } > __attribute__((dllexport)) void foo::bar () { } > /////////////////////////////////////////////////////////////////////// > > foo::bar() will be exported, foo::foo() won't. > > 2.95.3 and 2.95.3-1 export both. > That's because of the attribute handling in C++ front-end has changed in gcc-3.0 (and there's my hack in gcc-2.95.x that will never be accepted by the maintainers; for good reason too, since it peeks inside TREE_TYPE, which language-independent parts of the compiler shouldn't). I have two bug reports ready to go out; one I have a fix for, and if I can get a fix for the second one, I can fix this as well. Of course, the native compiler says that the "preferred" way to do is to export the whole class; however, that's what's broken in gcc-3.0. Regards, Mumit |