Search code examples
cwinapimingwmingw-w64mingw32

What is the use of w32api in minGW project


I have been reading about the minGW project and I am a bit confused about a specific part of it. If you look at http://www.mingw.org/wiki/MinGW, the "Packages included with minGW" section mentions a w32api package. What is that?

Since the project was able to produce a Windows port of gcc, wouldn't you just have to link the Windows c library instead of glibc and have it work?

In the same document it explains:

Header files and import libraries for the Microsoft Windows operating system

But doesn't Windows ALREADY provide header files and libraries for itself? Is the libc that minGW uses different from msvrct?


Solution

  • But doesn't Windows ALREADY provide header files and libraries for itself?

    No.

    Microsoft provides a Windows SDK, which includes C header files, and import libraries for use in Visual Studio only. Other compiler vendors ship those headers (making any tweaks they may require to compile) and import libraries that are appropriate for use in their own compilers.

    That is what the w32api package is for minGW. The files needed to compile Windows code in minGW's environment.