This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

A Solution: mingw in cygwin


After great gobs of my time trying to get a C++ console program to compile
under cygwin using -mno-cygwin, I found a solution (workaround).
Check out the link:
http://www.cse.buffalo.edu/~dafiden/cygwin/

Here is a transcription of the page:


Getting cygwin to compile C++ using -mno-cygwin
Install cygwin as normal.

Install the extra mingw headers and libraries from the
gcc-2.95.2-mingw-extra.tar.gz file.

Here's a link to a file I modified for convenience:
gcc-2.95.2-mingw-extra.tar.gz
(If this doesn't work, or if I find out I'm not allowed to do this ;),
just get the regular gcc-2.95.2-mingw-extra.tar.gz file from here:
ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/cygb20/gcc-2.95.2/gcc-2.95.2-mingw-extra.tar.gz
and make the files correspond to the structure defined below).

Setup the gcc-2.95.2-mingw-extra.tar.gz file as follows:

drwxr-xr-x dafiden/unknown   0 2001-11-04 13:35:16 lib/
drwxr-xr-x dafiden/unknown   0 2001-11-04 13:35:16 lib/mingw/
-rw-r--r-- dafiden/unknown 247138 1999-11-06 21:01:04 lib/mingw/libg2c.a
-rw-r--r-- dafiden/unknown 108104 1999-11-06 21:01:04 lib/mingw/libgcc.a
-rw-r--r-- dafiden/unknown 255248 1999-11-06 20:56:12
lib/mingw/libiberty.a
-rw-r--r-- dafiden/unknown    492 1999-11-07 04:36:26 lib/mingw/libm.a
-rw-r--r-- dafiden/unknown   6714 1999-11-09 01:43:22
lib/mingw/libmingw32.a
-rw-r--r-- dafiden/unknown 108840 1999-11-06 21:01:04 lib/mingw/libobjc.a
-rw-r--r-- dafiden/unknown 883758 1999-11-06 21:01:04
lib/mingw/libstdc++.a
drwxr-xr-x dafiden/unknown      0 2001-11-04 13:35:26 usr/
drwxr-xr-x dafiden/unknown      0 2001-11-04 13:35:16 usr/include/
drwxr-xr-x dafiden/unknown      0 2001-11-04 13:35:16 usr/include/mingw/
-rw-r--r-- dafiden/unknown   2797 1999-11-06 20:55:40
usr/include/mingw/_G_config.h

type this:
ln -s /usr/include/g++-3 /usr/include/mingw/g++-3

edit the file:
/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/specs
where it reads:
*libgcc:
%{mno-cygwin: %{mthreads:-lmingwthrd} -lmingw32} -lgcc
%{mno-cygwin:-lmoldname -lmsvcrt}
change it to read:
*libgcc:
%{mno-cygwin: %{mthreads:-lmingwthrd} -lmingw32} -lgcc
%{mno-cygwin:-lmoldname -lmsvcrt -lcrtdll}

You can check to see if it works with a "hello world" c++ program.
type:
g++ -mno-cygwin hello.cpp
a
(You can use my hello.cpp and check for a message with a 5 second sleep
in between)
If it works, "you done good."

I haven't done a lot of programming until recently, so I imagine that
mingw
libstdc++ looks for some DLL stuff in libcrtdll.  Consequently, one needs
to
add that lib to the default specs for g++.

EMAIL:dafiden@cse.buffalo.edu





--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]