Hardcore Processing - Realize Your Wild Software Ideas Affordably
WINMAIN
Versions of this document
There are HTML, LaTeX, PDF and PostScript versions of this document:
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.
I have only used this library for crosscompiling applications
from Linux to Windows with the Mingw32 cross-compiler version of gcc.
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
Modified: 2016-03-19
E-mail: Contact