Windows GCC Development

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
User avatar
jshriver
Posts: 1105
Joined: Wed Mar 08, 2006 8:41 pm
Location: Morgantown, WV, USA
Contact:

Windows GCC Development

Post by jshriver » Tue Jan 10, 2012 5:43 am

I'm tinkering with setting up a Windows development environment and looking for suggestions. I'm primarily a Linux guy so been looking at Cygwin which I used years ago and liked, and see there is also MinGW.

Anyone use either of these and mind a pro/con of either? I use C primarily and C++ only for interfacing with Nalimov egtb code.

Had also thought about trying Visual Studio Free edition, but I'm so engrained with using bash + gcc + vi + make that the last time I tried any VS I had a hard time figuring out how to do a simple non GUI C application and all the build options, added files into my code base and such.

-Josh

UncombedCoconut
Posts: 319
Joined: Fri Dec 18, 2009 10:40 am
Location: Naperville, IL

Re: Windows GCC Development

Post by UncombedCoconut » Tue Jan 10, 2012 7:38 am

MinGW is nice for building native Windows executables. If that's your main goal, you can actually set it up as a cross-compiler on Linux (the easiest method depends on your distro) and build with, say, CC=i686-pc-mingw32-gcc CXX=i686-pc-mingw32-g++.

User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 6:43 pm

Re: Windows GCC Development

Post by sje » Tue Jan 10, 2012 8:09 am

Due to MS bungling the underlying Win32 support, the Cygwin implementation of the select() library routine is a horrorshow underneath and should be avoided. Also with Cygwin, don't expect any support for Unix specific calls which reference user IDs, special file types, timers, some thread functions, etc.

User avatar
hgm
Posts: 23790
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Windows GCC Development

Post by hgm » Tue Jan 10, 2012 8:36 am

I always use gcc+cygwin for making the binaries of WinBoard and Polyglot that go into the WinBoard releases. That has never given me any problems.

There is one peculiarity in printing (long long int): the printf in the mcrts DLL that will eventually be called in a -mno-cygwin compile does interpret the formats in a non-standard way, which leads to spurious warnings on format-argument type mismatch by gcc, which does make the assumption the format means what the standard prescribes.

User avatar
lucasart
Posts: 3046
Joined: Mon May 31, 2010 11:29 am
Full name: lucasart
Contact:

Re: Windows GCC Development

Post by lucasart » Tue Jan 10, 2012 10:08 am

jshriver wrote:I'm tinkering with setting up a Windows development environment and looking for suggestions. I'm primarily a Linux guy so been looking at Cygwin which I used years ago and liked, and see there is also MinGW.

Anyone use either of these and mind a pro/con of either? I use C primarily and C++ only for interfacing with Nalimov egtb code.

Had also thought about trying Visual Studio Free edition, but I'm so engrained with using bash + gcc + vi + make that the last time I tried any VS I had a hard time figuring out how to do a simple non GUI C application and all the build options, added files into my code base and such.

-Josh
isn't it much easier to develop on linux, and compile with gcc for linux and windows with mingw, still on a linux machine ? that's what i do anyway: codelite for an IDE and gcc/mingw to compile for linix/windows.

jdart
Posts: 3842
Joined: Fri Mar 10, 2006 4:23 am
Location: http://www.arasanchess.org

Re: Windows GCC Development

Post by jdart » Tue Jan 10, 2012 3:35 pm

I have used cygwin but it's not my primary dev environment on Windows.

You can get the Windows SDK from Microsoft as a free download. (http://en.wikipedia.org/wiki/Microsoft_Windows_SDK). This is basically the command-line version of the Visual Studio compiler. It contains all the header files needed for native Windows app development. Note though this compiler lacks a few features such as PGO and does not include a profiler.

Microsoft NMAKE is not even remotely close to Gnu Make, and a lot less powerful. I have had to maintain two Makefiles, one for GCC or ICC, and one for Microsoft builds using Visual C++.

Dave_N
Posts: 153
Joined: Fri Sep 30, 2011 5:48 am

Re: Windows GCC Development

Post by Dave_N » Tue Jan 10, 2012 6:06 pm

I usually prefer an IDE with a debugger, that is the primary reason why I develop mostly in visual studio. I used mingw a lot a few years ago and mainly concentrated on getting things to compile in the terminal, I found most of the projects I downloaded would work on both linux and windows with a bit of makefile hacking. Mingw seemed to run most of my programs very fast, perhaps some extra safety checking in MSVC was to blame. CodeBlock's is a good IDE that supports mingw if you want to use a debugger.

User avatar
Jim Ablett
Posts: 1327
Joined: Fri Jul 14, 2006 5:56 am
Location: London, England
Contact:

Re: Windows GCC Development

Post by Jim Ablett » Thu Jan 12, 2012 8:41 pm

You can find the very latest official versions & 'bleeding edge' binaries of GCC for Windows here >
http://www.equation.com/servlet/equation.cmd?fa=fortran

Jim.

User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 2:27 pm

Re: Windows GCC Development

Post by Don » Thu Jan 12, 2012 8:47 pm

jshriver wrote:I'm tinkering with setting up a Windows development environment and looking for suggestions. I'm primarily a Linux guy so been looking at Cygwin which I used years ago and liked, and see there is also MinGW.

Anyone use either of these and mind a pro/con of either? I use C primarily and C++ only for interfacing with Nalimov egtb code.

Had also thought about trying Visual Studio Free edition, but I'm so engrained with using bash + gcc + vi + make that the last time I tried any VS I had a hard time figuring out how to do a simple non GUI C application and all the build options, added files into my code base and such.

-Josh
I make my komodo windows binaries from linux using mingw. Very easy and convenient and very portable. So there is no need to soil your hands or compromise your integrity or be seen using Windows if you do not have to do so.

User avatar
lucasart
Posts: 3046
Joined: Mon May 31, 2010 11:29 am
Full name: lucasart
Contact:

Re: Windows GCC Development

Post by lucasart » Fri Jan 13, 2012 2:12 pm

Don wrote:
jshriver wrote:I'm tinkering with setting up a Windows development environment and looking for suggestions. I'm primarily a Linux guy so been looking at Cygwin which I used years ago and liked, and see there is also MinGW.

Anyone use either of these and mind a pro/con of either? I use C primarily and C++ only for interfacing with Nalimov egtb code.

Had also thought about trying Visual Studio Free edition, but I'm so engrained with using bash + gcc + vi + make that the last time I tried any VS I had a hard time figuring out how to do a simple non GUI C application and all the build options, added files into my code base and such.

-Josh
I make my komodo windows binaries from linux using mingw. Very easy and convenient and very portable. So there is no need to soil your hands or compromise your integrity or be seen using Windows if you do not have to do so.
me too, and i cannot agree more with your comments about Windows :D

Post Reply