PDA

View Full Version : Compile Unix/Linux C for Windows?



funkadelic
March 2nd, 2009, 04:56 PM
I would very much like to "port" dadadodo (http://www.jwz.org/dadadodo/) to Windows. It is command-line only and "it should be fairly portable ANSI C" ...

How difficult would this be for a (mostly) novice programmer? Could someone point me in the right direction to get started?

Many thanks.

loganwm
March 2nd, 2009, 05:30 PM
You can start by downloading the source code and noting which libraries it uses to function.

IF there's one for example that doesn't work on Linux (or Vice Versa) you would need to rewrite that section using a comparable library or technique to attempt the same function.

I'm not very good at porting, but I understand the principles behind it, and after taking a look at this program it looks like a lot of universal functions which should port very nicely.

Simian Man
March 2nd, 2009, 05:36 PM
Cygwin (http://www.cygwin.com/) is your friend.

stevescripts
March 2nd, 2009, 07:47 PM
Along with cygwin - take a look at mingw/msys

monkeyking
March 2nd, 2009, 07:49 PM
yes go with mingw,
but you should know that there exist no gnu toolchain for win64.

Krupski
March 3rd, 2009, 01:18 AM
I would very much like to "port" dadadodo (http://www.jwz.org/dadadodo/) to Windows. It is command-line only and "it should be fairly portable ANSI C" ...

How difficult would this be for a (mostly) novice programmer? Could someone point me in the right direction to get started?

Many thanks.

You may like this:

http://www.q-software-solutions.de/downloaders/get_name

Then click "Get me to the downloads".

LCC Win32 is a nice 32 bit C/C++ compiler and IDE for Windows.

I write small, simple utilities in C and usually develop and debug them in LCC (because it has a nice IDE and debugger), then I carry the code over to Linux.

Most time, it compiles just fine as-is under GCC.

Granted, what I write is VERY simple, console mode ANSI compatible stuff. More complex code may not port over so easily.

Give it a try and see if you like it. Be sure to get the "manual.exe" and the online documentation for it.

-- Roger