Windows GCC Development

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
jshriver
Posts: 1342
Joined: Wed Mar 08, 2006 9:41 pm
Location: Morgantown, WV, USA

Windows GCC Development

Post by jshriver »

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 11:40 am
Location: Naperville, IL

Re: Windows GCC Development

Post by UncombedCoconut »

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 7:43 pm

Re: Windows GCC Development

Post by sje »

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: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Windows GCC Development

Post by hgm »

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: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Windows GCC Development

Post by lucasart »

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: 4366
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: Windows GCC Development

Post by jdart »

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 7:48 am

Re: Windows GCC Development

Post by Dave_N »

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: 1383
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: Windows GCC Development

Post by Jim Ablett »

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 4:27 pm

Re: Windows GCC Development

Post by Don »

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: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Windows GCC Development

Post by lucasart »

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