openbsd-ports/devel/mingw/pkg
jeremy 728ba90dfb Include the necessary header path and library path automatically, so
you don't need to specify -I/usr/local/mingw32/include
-L/usr/local/mingw32/lib manually to make things work.

OK pirofti@
2012-04-02 03:18:17 +00:00
..
DESCR
PLIST Remove SHARED marker from PLIST. Noticed by jeremy@, thanks. 2011-11-17 15:52:39 +00:00
README Include the necessary header path and library path automatically, so 2012-04-02 03:18:17 +00:00

$OpenBSD: README,v 1.3 2012/04/02 03:18:17 jeremy Exp $

+-----------------------------------------------------------------------
| Running ${FULLPKGNAME} on OpenBSD
+-----------------------------------------------------------------------

Environment Setup
=================
Set the mingw32 binary path before all the others. Like so:

$ export PATH=/usr/local/mingw32/bin:${PATH}

Generating PE files
===================
Just compile like you regulary would:

$ cat CreateFile_test.cpp
#include <windows.h>

int main (void)
{
        HANDLE handle;

        handle = CreateFile ("test.txt", GENERIC_READ | GENERIC_WRITE,
	    0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);

        return 0;
}

$ g++ CreateFile_test.cpp -o CreateFile_test.exe
$ file CreateFile_test.exe
CreateFile_test.exe: MS-DOS executable PE  for MS Windows (console)
Intel 80386 32-bit