views:

425

answers:

12

What is a good toolset for doing C cross platform development on Windows?

+1  A: 

Cross platform? GCC!

Dave Markle
+3  A: 

GCC for the compiler, Eclipse + CDT for the IDE

Babak Naffas
A: 

As for build system consider using cmake. It will enable you to compile your code in Visual Studio, Eclipse, Kdevelop or just old and plain make. This way you can pick up your favorite IDE on each platform.

Regarding the code itself. I personally don't familiar with cross platform packets for C. These exists for C++ (ACE and boost are most known). Some advises - keep OS depend parts of code as small as possible and include them in #if/#else sections, avoid using OS propriety API, use standard as far as possible.

dimba
+2  A: 

Alternatively: Cygwin and Vim/Emacs.

Yuval A
+1  A: 

I have to agree with the poster who said 'gcc' for cross-platform work. You can install gcc under cygwin though I've never been tempted to do this for real work. I always have a Linux machine somewhere. [edit -- even if it's only in a virtual machine on the same box!]

With a judicious use of ssh, samba and/or NFS, you can always have your dev environment be Windows, while actually building on Linux.

+2  A: 

You can use GCC via MinGW. Some people also recommend Cygwin, but in practice it's a pain. Eclipse+CDT, as suggested by bnaffas, is pretty good.

rob
The main pain I find in cygwin is that you have to type /cygdrive/c/ instead of c:/ if you want auto-completion to work. Seriously. On the other hand, if you ever use Windows-style linebreaks in your text files then YMMV a lot, because some of the programs that come with cygwin barf on them if you take the "UNIX linebreaks" option.
Steve Jessop
A: 

A toolset based on GCC (as suggested by others) is certainly OK.

Visual Studio (Visual C++) allows you to do C/C++ development as well. Keeping your code cross-platform obviously requires a little discipline, but it is certainly doable.

jeroenh
+2  A: 

Bloodshed dev c++ is very nice. If you've used older versions of Visual Studio like I have then you'll feel right at home. Best of all, it's free. Under the hood it uses the MingW port of GCC which is a compiler available on many platforms so if you need portable C++ code then this is a great start.

I believe the IDE is written in C++ (not java) so it's nice and responsive too.

http://www.bloodshed.net/devcpp.html

EDIT: Would like to suggest Code::Blocks. It's also a cross platform GUI.

Matt H
no it is *not* very nice. It is an ancient piece of junk which hasn't been updated since 2005, and even back then, was still buggy as hell and missing half the features you'd expect. It is the one tool that *no* sane developer should never use. Just... don't. http://www.jasonbadams.net/20081218/why-you-shouldnt-use-dev-c/
jalf
Fair comment. On reading that link I am inclined to suggest using Code::Blocks. Anyone had any experience with that?
Matt H
Code::blocks is amazing now. it used to be that the rc was loads out of sync with the development version, but that's changed reciently. the hardest part i've seen for most of my peers is telling the thing where mingw resides.
Ape-inago
http://www.codeblocks.org/
Ape-inago
A: 

My favorite cross-platform development environment is AT&T U/Win, which compiles native Windows apps using a Posix interface. The learning curve is a bit steep, because these guys control everything, and it's slightly nonstandard from the ground up. Example: they have their own replacements for autotools and make. But they are great engineers and have been doing this for 25 years. Solid, solid stuff.

Norman Ramsey
A: 

On windoze I am using code:blocks + gcc. It also supports muliple compilers and switching betwen them is just matter of few clicks. You can get instalation pack whit gcc included is simple intuitive and they have good documentation.

ralu
A: 

gcc and notepad

bLee
A: 

Visual Studio is actually a nice tool for doing C development. You need to forsake all Windows libraries and use only platform-independent header files. Normally I would install cygwin to get some of the windows missing header files. I've noticed other libraries / applications have taken the cygwin approach and accepted it as a valid windows platform-independant build target.

Kieveli