From: Luke D. <cod...@ho...> - 2002-05-18 13:51:35
|
----- Original Message ----- From: "Oscar Fuentes" <of...@wa...> To: <min...@li...> Sent: Saturday, May 18, 2002 4:22 PM Subject: Re: [Mingw-users] Problems with gcc 3.1 and dll's > > Also, as reported on previous msgs on this thread, in all cases > wxWindows 2.2.9 is unusable as a dll. I guess the culprit here /seems/ > gcc, as at least MinGW 1.1 builds a valid dll. > I have verified that the following code is not compiled correctly with Mingw gcc 3.1: ///// class __attribute__((dllexport)) Foo { void func(); }; class Bar { friend class Foo; }; void Foo::func() { } ///// Compiling with "gcc -S export.cpp", the output is: .file "export.cpp" .text .align 2 .globl __ZN3Foo4funcEv .def __ZN3Foo4funcEv; .scl 2; .type 32; .endef __ZN3Foo4funcEv: LFB1: pushl %ebp LCFI0: movl %esp, %ebp LCFI1: popl %ebp ret LFE1: If the "friend" declaration is removed, the function is correctly exported: .section .drectve .ascii " -export:_ZN3Foo4funcEv" In wxWindows this causes the wxObject constructor to not be exported, while most classes are exported properly. However, some members of wxObject ARE exported, but I don't have a test case yet to demonstrate which ones. Luke |