Hardcore Processing - Realize Your Wild Software Ideas Affordably


Start Here | News | For Artists | For Developers | Products & Projects | Research & Articles | Entertainment | Company Profile | Contact

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.


  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           

Hardcore ProcessingModified: 2016-03-19
E-mail: Contact