Hardcore Processing - homepage
WINMAIN
Versions of this document
There are LaTeX, PDF and PostScript versions of this document:
The online HTML version can be found at:
Introduction
WinMain is a very small library which will make
'C' or 'C++' programs written for
other operating systems than Windows compile on
the Windows operating systems.
Installing
- Download and unpack this file: WinMain_20000907.tar.gz
- Unpacking can usually be done with these commands:
gzip -d WinMain_20000907.tar.gz
tar -xvf WinMain_20000907.tar
- This will create a directory called WinMain and a
subdirectory called srcC.
Go to this subdirectory by typing:
cd WinMain/srcC
- To use the library for crosscompiling applications from
Linux to Windows, activate your gcc crosscompiler (by setting
the appropriate paths) and type:
make target=win32
This should hopefully create a library file called libwinmain.a.
This library was written for crosscompiling from Linux to
Windows so this is the only way it has been tested. However it
might also work for crosscompiling from other operating
systems to Windows or for compiling natively on Windows
since the makefiles also should support other operating systems.
Using WinMain in your projects
- Include the file winmain.h in the C sourcecode file with your main function,
like this:
#include <winmain.h>
When using gcc you should problably add this
compiler flag:
-I<path_to_WinMain>/WinMain/srcC
- Link your application with libwinmain.a. With gcc this is done with these
2 compiler flags:
-L<path_to_WinMain>/WinMain/srcC -lwinmain