在 2022-03-10 06:20, Vishal Subramanyam 写道:
Hey,
I'm confused about the header files and libraries that MinGW-w64 provides? Does it provide just header files (along with certain libraries like libstdc++) that enable the compiler to link against Microsoft-provided DLLs (along with some MinGW-specific DLLs)? What is the relation between the files and programs provided by the Windows SDK and MinGW-w64? How are they similar/different? Does the Windows SDK offer additional DLLs and header files (or additional header files that expose functions in the system DLLs not exposed by MinGW's header files)? Apart from the Win32 API, does MinGW support newer APIs like WinRT?

Thanks,
Vishal Subramanyam

P.S. As a noob, how can I be of help to the project?



For Windows targets, GCC uses Application Binary Interfaces (ABI) that are largely compatible with what MSVC uses (except `long double` on x86). We provide headers that can be fed to GCC (and Clang in GCC mode), as they have trouble in compiling MS headers. We provide libraries that can be picked up by the GNU linker (and LLD). Therefore, we make it possible to use the GNU compiler and linker to compile source code into executables on top of MSVCRT.DLL, KERNEL32.DLL, etc. without an emulation layer or subsystem whatsoever.

While the C ABI is large compatible, the C++ ABI is much more complex when we take exceptions and name mangling into account. Hence, it is usually not possible to call C++ functions that have been exported from DLLs produced by MSVC, unless they are `extern "C"` ones. (Also please note libstdc++ (with standard headers) is provided by GCC, not mingw-w64.)

We can also provide something that MSVC doesn't, for example `*printf()` and `*scanf()` that conform to the C99 standard, and winpthreads that provide POSIX threading APIs.

Our headers and libraries are maintained actively by the community, so new stuff may come in at any time. We try to keep up with Windows SDK, but which is also evolving, therefore we may be kept back a little.



--
Best regards,
LIU Hao

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to