Compiling with Cygwin and MinGW
by John Clark, Jr. · in Torque Game Engine · 11/05/2004 (6:13 am) · 8 replies
Hello,
If anyone is interested, here's what you need to do to get TGE to compile with gcc v3 in MinGW mode under the Cygwin environment without any dependency on cygwin1.dll.
First, make sure you have the following Cygwin packages installed:
gcc
gcc-core
gcc-g++
gcc-mingw
gcc-mingw-core
gcc-mingw-g++
mingw-runtime
Make a few small modifications to 'mk/conf.GCC3.WIN32.mk':
Basically, changing the link step to use 'g++' instead of 'ld' and passing the '-mno-cygwin' option to all compile and link steps makes it work. '-lmingw' was removed from the LINK.LIBS lines because it's included by '-mno-cygwin'. I've only been working with Release_1_3_0, so that's the only version I can guarantee this works.
No one probably cares because it's easy just to go out and get MinGW separately, but I thought I'd let you know.....
- John
P.S. Hi, I'm new here!
If anyone is interested, here's what you need to do to get TGE to compile with gcc v3 in MinGW mode under the Cygwin environment without any dependency on cygwin1.dll.
First, make sure you have the following Cygwin packages installed:
gcc
gcc-core
gcc-g++
gcc-mingw
gcc-mingw-core
gcc-mingw-g++
mingw-runtime
Make a few small modifications to 'mk/conf.GCC3.WIN32.mk':
LINK.cc =g++ CFLAGS.GENERAL = -mno-cygwin -Wno-conversion -MD -march=i586 -fno-exceptions -fpermissive # -mwin32 LFLAGS.GENERAL = -mno-cygwin # -m i386pe LINK.LIBS.GENERAL = -lcomdlg32 -luser32 -ladvapi32 -lgdi32 -lwinmm -lwsock32 -lvfw32 $(LINK.LIBS.VORBIS) LINK.LIBS.TOOLS = -lcomdlg32 -luser32 -ladvapi32 -lgdi32 -lwinmm -lwsock32 -lvfw32
Basically, changing the link step to use 'g++' instead of 'ld' and passing the '-mno-cygwin' option to all compile and link steps makes it work. '-lmingw' was removed from the LINK.LIBS lines because it's included by '-mno-cygwin'. I've only been working with Release_1_3_0, so that's the only version I can guarantee this works.
No one probably cares because it's easy just to go out and get MinGW separately, but I thought I'd let you know.....
- John
P.S. Hi, I'm new here!
#2
thanks a ton!!
@Joerg:
(shameles plug) There is one :) search the resources for eclipse. Which will be updated shortly to include using it with cygwin
-Ron
12/01/2004 (3:16 am)
I'll have to give this a try at work today, been fighting cygwin for ages now. Never gave it much of a look into though, had other fish to fry.thanks a ton!!
@Joerg:
(shameles plug) There is one :) search the resources for eclipse. Which will be updated shortly to include using it with cygwin
-Ron
#3
My battle with the compiler has just begun ;-)
Edit: Oh, I'm totally confused now as I confounded this with a howto from scratch.
cheers,
jono
12/01/2004 (3:39 am)
Thanks for the pointer, Ron.My battle with the compiler has just begun ;-)
Edit: Oh, I'm totally confused now as I confounded this with a howto from scratch.
cheers,
jono
#4
12/01/2004 (3:47 am)
MinG also has a decent (if slightly old) command line version of GDB (debugger) which I've found to be pretty useful if you don't want to mess with/don't have an IDE. The link is on the same page as the executables listed above, and was easy to install.
#5
Awesome.. I've been looking for an alternate compiler to compile this up. I really don't like the MS compilers and this saved me from a horrific cost in upgrading my OS and shelling money out for a compiler. After some very minor fooling around I managed to get a working debug version of the demo built.
It was slightly un-nerving to see so many warnings..
.. did I mention I am newbie to this... heheh
12/05/2004 (1:01 pm)
John,Awesome.. I've been looking for an alternate compiler to compile this up. I really don't like the MS compilers and this saved me from a horrific cost in upgrading my OS and shelling money out for a compiler. After some very minor fooling around I managed to get a working debug version of the demo built.
It was slightly un-nerving to see so many warnings..
.. did I mention I am newbie to this... heheh
#6
12/05/2004 (1:15 pm)
Yeah, I think I might have to go this way on Windows. VS6 will only take me so far, and the thought of updating it makes me queasy.
#7
Thanks for sorting this out.
01/07/2005 (12:11 am)
I've been compiling TGE with Cygwin and a separate installation of MinGW for quite a while with no problems but I always wondered why I couldn't just use the MinGW included with Cygwin.Thanks for sorting this out.
#8
For any newbies just hitting this thread, though, (shameless plug) don't forget to try out the new Torque Build Environment which makes all this pretty easy. It uses only minGW, and also installs Eclipse all set up to compile torque.
01/11/2005 (12:27 pm)
Hey, thanks for the tip John! I got stuck once trying to do torque-mysql compile, because both torque (compiled under cygwin) and mysql (also compiled under cygwin) used cygwin1.dll and they couldn't exist together at the same time. Sucked.For any newbies just hitting this thread, though, (shameless plug) don't forget to try out the new Torque Build Environment which makes all this pretty easy. It uses only minGW, and also installs Eclipse all set up to compile torque.
Torque Owner Jono
Thanks anyways, exactly I was searching for. Great for noob like me ;-)