2.2. C library

There are two choices available to you regarding which C library to use: the native glibc C library or the msvcrt C library.

Note that under Wine, the crtdll library is implemented using msvcrt, so there is no benefit in trying to use it.

Using glibc in general has the lowest overhead, but this is really only important for file I/O, as many of the functions in msvcrt are simply resolved to glibc.

To use glibc, you don't need to make changes to your application; it should work straight away. There are a few situations in which using glibc is not possible:

  1. Your application uses Win32 and C library unicode functions.

  2. Your application uses MS specific calls like beginthread(), loadlibrary(), etc.

  3. You rely on the precise semantics of the calls, for example, returning -1 rather than non-zero. More likely, your application will rely on calls like fopen() taking a Windows path rather than a Unix one.

In these cases you should use msvcrt to provide your C runtime calls.

Add -mno-cygwin to your compiler flags. This will cause winebuild to resolve your C library calls to msvcrt.dll.