This is the mail archive of the
mailing list for the Cygwin project.
RE: Compiling apps to Mingw32 with cygwin
- From: "Jon Leichter" <jonleichter at mediaone dot net>
- To: "J. Henning Schwentner" <hschwentner at yahoo dot com>
- Cc: <cygwin at cygwin dot com>
- Date: Sat, 5 Jan 2002 11:35:14 -0800
- Subject: RE: Compiling apps to Mingw32 with cygwin
- Reply-to: "Jon Leichter" <jon at symas dot com>
You can use Cygwin's GCC. It's just a little more involved. Here's a short
answer. When you configure, do so like this:
$ env CC="gcc -mno-cygwin" ./configure --host=i386-pc-mingw32
Notice that your --host specification was a little off. The way that I have
specified it is the standard way. If your configure script uses the format
that you've specified then your format is correct.
If your configure script uses Libtool, then the above method will not be
sufficient. Libtool likes to strip the -mno-cygwin switch off at link time.
For this, I use a wrapper script for MinGW. It's called mgcc, and it looks
$ cd /usr/bin
$ cat > mgcc
gcc -mno-cygwin $*
Now your configure line looks like this:
$ env CC=mgcc ./configure --host=i386-pc-mingw32
There's one more GOTCHA. Cygwin GCC will look in /usr/lib no matter what.
Thus if it finds a library in there that it doesn't find in /usr/lib/mingw,
it will use it. That means when your configure script looks for a library
that MinGW does not support, it believes that you do have it, and it will
try to link it. Most of the time, MinGW does support the libraries that a
configure script is looking for. So you may not have to worry about it.
However, there is a workaround for this too.
I wrote a detailed document on this topic, and it's posted on OpenLDAP's web
site in their FAQ section:
It will explain how to fix the last GOTCHA as well...
> -----Original Message-----
> From: email@example.com [mailto:firstname.lastname@example.org]On Behalf
> Of J. Henning Schwentner
> Sent: Saturday, January 05, 2002 7:42 AM
> To: email@example.com
> Subject: Compiling apps to Mingw32 with cygwin
> I am trying to compile SDL-1.2.3 for mingw32 with cygwin-1.3.6.
> I use the following steps:
> $ ./configure --host=pc-i386-mingw32
> # make
> It compiles without errors, but the outcoming SDL.dll has references to
> cygwin1.dll not to MSVCRT.dll.
> I have also installed Mingw32-1.1. Do I have to use the gcc from the
> mingw-distribution or can I use the cygwin-gcc? If I have to use the
> mingw-gcc, how can I tell this to configure?
> Thanks in advance!
> P.S: Please CC me, I am not on the list
> J. Henning Schwentner
> Lanthan Software KG
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
> Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting: http://cygwin.com/bugs.html
> Documentation: http://cygwin.com/docs.html
> FAQ: http://cygwin.com/faq/
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html