User forums > Help

A note about the Windows builds

<< < (2/6) > >>

takeshimiya:
I can add that if you want to remove the zillion warnings "No attribute... " produced under MinGW, just open wxWidgets-2.6.2\build\msw\makefile.gcc and do a search&replace of all "-Wall" and "-W" (check only the whole word) and replace them with " ".

From what I've read from word of wx core developers, those zillion "No attribute... " warnings are produced by a bug in specifics version of MinGW.

thomas:
Actually they're produced because they're not using it properly...


EDIT:
In case you're interested in the exact cause, it is the use of __declspec.
This is MSVC syntax, not valid for MinGW. Who said using compiler-specific stuff was bad practice?

Anyway, as a workaround for the ignorant, MinGW has a __declspec macro, which looks like
--- Code: ---#define __declspec(x) __attribute__ (( x ))
--- End code ---
Maybe it looks slightly different, I did not learn it by heart, but it should be about like this  ;)

But... they do not only use compiler-specifics in wxWidgets, they also use them in places where they should not, hence the warning "Attributes are only honoured..."


And you all were bashing me for using attributes and underscores...  8)

takeshimiya:
Well, that gives a leson, using compiler specific extensions should be taken with a lot of care.

EDIT: But actually wx uses this:


--- Code: ---#if defined(__WXMSW__)
    /*
       __declspec works in BC++ 5 and later, Watcom C++ 11.0 and later as well
       as VC++ and gcc
     */
#    if defined(__VISUALC__) || defined(__BORLANDC__) || defined(__GNUC__) || defined(__WATCOMC__)
#        define WXEXPORT __declspec(dllexport)
#        define WXIMPORT __declspec(dllimport)
#    else /* compiler doesn't support __declspec() */
#        define WXEXPORT
#        define WXIMPORT
#    endif
#endif
--- End code ---

It is not correct for MinGW?

thomas:
Compiler specifics are absolutely ok, you only have to write an evil macro that disapbles or mangles the compiler-specific on platforms that don't support it.
It is a shame actually that you really have to use macros here...

280Z28:
I just remember when I had it set up with the default paths I had to modify the .cbp file (or move the output *.a files from gcc_dll to gcc_dll/msw(u) ), but when I set CFG, it worked without modifications or moving anything. Have you since changed the library directories in the project file?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version