views:

220

answers:

3

I'd like to make a big project of mine buildable on Windows platforms. The project itself it's written in C/C++ following POSIX standards, with some library dependencies such as libxml2, libcurl and so on. I'm more a Linux developer rather than a Windows developer, so i have no idea of which compiler suite i should use to port the code. Which one offers more compatibility with gcc 4.4.3 i'm using right now?

My project needs flex and bison, is there any "ready to use" environment to port such projects to windows platforms?

Thanks.

+1  A: 

I very much doubt either cygwin nor mingw is up to 4.4.3 yet. I would bet on being able to upgrade the compiler in mingw to be easier.

You'll need cygwin if you're actually using any Linux specific stuff. The libraries you listed off aren't an issue I don't think. POSIX could be, depending.

Noah Roberts
MinGW is actually up to 4.5 - you can get it at http://nuwen.net/mingw.html
anon
@Neil: Official MinGW distribution has guarantee of quality and release schedule. Projects such as KDE and Nokia Qt rely on the official MinGW. Btw, it's not always a good idea to jump from 4.4.3 straight to 4.5.0, in case of incompatibility. Btw, the official MinGW also has 4.5.0. The previous version that it distributes was 4.4.0, not the patched/updated 4.4.3.
Viet
@Viet I've had no problems (the opposite in fact) with the TD version I recommended in my answer. I've never used the nuwen version seriously, but it is easy to install, so I thought I'd mention it. And I will do almost anything to avoid using the MinGW website :-)
anon
@Neil: I bookmarked the official MinGW download page actually, to avoid reading that spaghetti site ;)
Viet
+4  A: 

If you don't use any UNIX system calls so you can run on Windows freely. There are flex & bison for windows too: http://gnuwin32.sourceforge.net/packages.html . You can go ahead with MinGW: http://www.mingw.org/ .

If you have UNIX system calls, then you have to use cygwin: http://www.cygwin.com/ , http://en.wikipedia.org/wiki/Cygwin .

Viet
Probably i'm going to port the code using precompiling directives to determine the OS i'm on, so even if there're some unix calls it's not a big issue.
Simone Margaritelli
If you don't mind writing OS-specific system calls so the macros with MinGW are sufficient. If writing Windows code to replace those UNIX-specific system calls are problems for you, use Cygwin. But remember that DLL by Cygwin is GPLed: http://www.cygwin.com/ml/cygwin/1999-07/msg00348.html.
Viet
+9  A: 

If it were me, I would install the following:

This is effectively the environment I do my own programming in, and it works very well. If you want an IDE, I'd recommend Code::Blocks, but both gvim and emacs are available for Windows too.

anon
That's all i need, thanks :)
Simone Margaritelli
Viet
Drew Hall