Hardcore Processing - homepage


Welcome | Company profile | News | Products | Freeware | Researchlabs | Knowledge | Entertainment | Private

Versions of this document

There are LaTeX, PDF and PostScript versions of this document:

The online HTML version can be found at:


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.


  1. Download and unpack this file: WinMain_20000907.tar.gz
  2. Unpacking can usually be done with these commands:
    gzip -d WinMain_20000907.tar.gz
    tar -xvf WinMain_20000907.tar
  3. This will create a directory called WinMain and a subdirectory called srcC. Go to this subdirectory by typing:
    cd WinMain/srcC
  4. 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

  1. 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:
  2. Link your application with libwinmain.a. With gcc this is done with these 2 compiler flags:
    -L<path_to_WinMain>/WinMain/srcC -lwinmain           

- ÁNOQ of the Sun

Modified: 2000-09-07