Thanks Michael.


Michael Gerdau <mgd@technosis.de> wrote:
> I am trying to compile a c++ program.
> I received a bunch of errors related to the include files.
> I posted to a C++ group and they said the following:
>
> WINADVAPI is #defined by windows.h to __declspec(dllimport).
> I guess that gcc doesn't support this keyword, so it looks like you
> can't use windows.h with gcc without some special include files to
> fix the incompatibilities.
>
> Is there a workaround in mingw for this?

MinGW's winbase.h is missing a proper #define for WINADVAPI.

Adding something like the following to the beginning of winbase.h
should get you started until there is a proper patch:

Signed-off by Michael Gerdau
(actually I mostly copied it from winbase.h)

#ifndef WINADVAPI
#ifdef __W32API_USE_DLLIMPORT__
#define WINADVAPI DECLSPEC_IMPORT
#else
#define WINADVAPI
#endif
#endif

HTH, best,
Michael
--
Vote against SPAM - see http://www.politik-digital.de/spam/
Michael Gerdau email: mgd@technosis.de
GPG-keys available on request or at public keyserver


Yahoo! Shopping
Find Great Deals on Holiday Gifts at Yahoo! Shopping