Hi List I'm finally on my ass trying to redo the ATL/MFC Job from a year ago. This time I decided to start on windows with MinGW than move the MinGW makefiles to be used with winegcc. It is a grate test for winegcc and the windows API in general. Well it turns out to be a very big test for MinGW as well. The headers are in a very bad shape. I had to use Wine headers to be able to compile. but I'll leave all that to a later e-mail.
[Q] I'm (well ATL is) using __attribute__((weak)) (translated from __declspec( selectany) ) for instantiation of members and variables in headers. I had no problem with it On GCC in Linux (gcc 3.2.2). On MinGW I get below warning. And needless to say that I get a Linker duplicate symbol Error. Any Ideas on how to overcome this. Is this a g++ only bug?
<g++ warning example> H:\Dinosaur\OneSource\MinGWStudio\msvc\atl\include\atlhost.h:56: warning: weak declaration of `UINT ATL::WM_ATLGETCONTROL' not supported </g++ warrning example>
<linker error example> H:\Dinosaur\OneSource\MinGWStudio\msvc\atl\include\atlwin.h: multiple definition of `ATL::WM_ATLGETCONTROL' H:\Dinosaur\OneSource\MinGWStudio\Samples\AtlWB\Debug\aboutdlg.o(.bss+0x1c):H:\Dinosaur\OneSource\MinGWStudio\msvc\atl\include\atlwin.h: first defined here </linker error example>
Please forgive me for sending it here and not to MinGW list. But I feel more at home here than there. ( :( )
Free Life Boaz
Boaz Harrosh wrote:
[Q] I'm (well ATL is) using __attribute__((weak)) (translated from __declspec( selectany) ) for instantiation of members and variables in headers. I had no problem with it On GCC in Linux (gcc 3.2.2). On MinGW
IMAGE_COMDAT_SELECT_ANY is not quite same as PECOFF version of "weak" , but AFAICT is equivalent to the GCC section flag ".linkonce discard". I don't think there is a way for the user to specify that for data using an attribute, but it could be done with asm statements.
.weak directive is partially supported in current binutils CVS. __attribute__((weak)) is not supported by GCC-3.4.x but will be in the next major GCC release (4.0.0).
The semantics of weak for PECOFF differ from that on Linux.See the PECOFF60 specs (Microsoft Portable Executable and Common Object File Format Specification) section on weak externals
Danny
WineMine Now Reactos Mine Sweeper
Loglist
Enable Sound Support Correctet some bugs in reg load save Correctet some minor bugs Implentet Help and about Modifed the style and the pictures
Who will upload this for me will not send the patch to all this time'
Thomas
__________________________________ Do you Yahoo!? The all-new My Yahoo! - Get yours free! http://my.yahoo.com