#135 windows.h causes compilation error

header (101)

Attached is a source file that compiles fine with MinGW but not MinGW-w64. The compilation error only occurs when the windows.h header file is included:

In file included from e:\dev\mingw-w64\bin\../lib/gcc/x86_64-w64-mingw32/4.4.3/../../../../x86_64-w64-mingw32/include/winnt.h:1216,
from e:\dev\mingw-w64\bin\../lib/gcc/x86_64-w64-mingw32/4.4.3/../../../../x86_64-w64-mingw32/include/windef.h:128,
from e:\dev\mingw-w64\bin\../lib/gcc/x86_64-w64-mingw32/4.4.3/../../../../x86_64-w64-mingw32/include/windows.h:62,
from test.cpp:7:
e:\dev\mingw-w64\bin\../lib/gcc/x86_64-w64-mingw32/4.4.3/../../../../x86_64-w64-mingw32/include/intrin.h:351: error: 'void* mymemcpy(void*, const void*, size_t)' redeclared as different kind of symbol
test.cpp:4: error: previous declaration of 'void* (* mymemcpy)(void*, const void*, size_t)'


  • Grant Pedersen

    Grant Pedersen - 2009-12-20
  • Kai Tietz

    Kai Tietz - 2009-12-21
    • status: open --> closed-invalid
  • Kai Tietz

    Kai Tietz - 2009-12-21

    This testcase is illegal, as you shadow a builtin function by an implementation of different type and then you are wondering, why an failure occures.
    Sorry, but have to include first system/platform headers and then afterward you can rename C-runtime functions. That mingw.org's header set doesn't fail, isn't reasoned by the fact, that your source is vaild. Instead it just shows that mingw.org doesn't provide intrin.h functionality.

    Please adjust your source here.

    Best regards,


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks