Using Cygwin created DLL in MSVC++?

Tor Lillqvist tml@iki.fi
Sun Oct 31 19:54:00 GMT 1999


Dongho Kim - Experimental Account writes:
 > - Is it possible to uses DLLs that are created using Cygwin
 >   from a program created using MS VC++?

Yes, but only if the DLL are created using (tools running under)
cygwin, but not use the cygwin dll itself. I.e. they should be
"mingw32" DLLs, created using gcc -mno-cygwin. If you share data
structures with the MSVC-compiled code, use -fnative-stuct also. (This
is available only in gcc-2.95 and later.)

It probably also is necessary to use the same MS C runtime in the DLL
and program, ie if the program uses msvcrt.dll, you should set up your
gcc to produce bnaries that use it, too, and not crtdll.dll, which is
the default. This might be a bit convoluted. I think it was enough to
edit the specs file. My specs file included here:


More information about the Cygwin mailing list