Tuesday, November 11, 2003

Getting Started with MinGW

Getting started with MinGW


So I'm trying to dust off my very rusty (and crusty) C and C++ skills and I've downloaded the MinGW compiler and the MSYS package. On the plus side, compiling with MinGW means that you don't need the Cygwin stuff in order to distribute windows-only binaries - but on the down side, MinGW has very little documentation (I have yet to find a central site). I guess you could try the GCC home pages since MinGW is a port of the GCC compiler collection.

Anyway, it took me a bit to figure out how to compile and link a C application where I have (1) module (usage.c and usage.h) and (1) program (main.c). To compile this into a working .exe file requires the following steps if you're doing it by hand:

gcc -c -o usage.o usage.c
gcc -c -o main.o main.c
gcc -o main.exe main.o usage.o

Now that I know those basics, I need to remember how to use makefiles...

No comments: