Hardcore Processing - Realize Your Wild Software Ideas Affordably
Versions of this document
There are HTML, LaTeX, PDF and PostScript versions of this document:
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.
I have only used this library for crosscompiling applications
from Linux to Windows with the Mingw32 cross-compiler version of gcc.
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.
- 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:
- To use the library for crosscompiling applications from
Linux to Windows, activate your gcc crosscompiler (by setting
the appropriate paths) and type:
This should hopefully create a library file called libwinmain.a.
Using WinMain in your projects
- Include the file winmain.h in the C sourcecode file with your main function,
When using gcc you should problably add this
- Link your application with libwinmain.a. With gcc this is done with these
2 compiler flags: