   Compileing V and applications using Mingw32 g++ 2.8.1


Now that there seems to be a really good, stable version
of GNU C++ for Windows, namely the mingw32 2.8.1 distribution,
V will be kept in sync with that distribution.
instructions for rebuilding V for mingw32.


******* TO REBUILD THE V LIBRARY FOR MINGW32 *******

1. Unzip the V Windows distribution. You must be sure to use
   an unzipper that preserves file case, or manually rename all
   the files to use lower case. While Windows doesn't care,
   gnu make does.

2) Make sure these directories exist:
        v/bin/mingw32
        v/lib/mingw32
        v/obj/mingw32

3) Copy the mingw32 version of ConfigMW.mk (included in this archive)
   to the main V directory as Config.mk. It defaults to assuming that
   the V source has been unzipped on C:\v. You can edit Config.mk to
   change this. 

4) The Makefile in the /V root directory works under Unix flavors,
   but does not work for Windows. However, the rest of the
   Makefiles for the V library and utilities (iconed, etc.) are
   identical for mingw32 and X. Neat, isn't it? 

   Also, you MAY need to copy C:/v/mingw32/commctrl.h to
   C:/mingw32/include/commctrl.h (or whereever the mingw32
   /include directory is on your system.) You need this file to compile
   V 1.18 and later for the Common Control dll. You will also
   add -lcomctl32 to your link lines in your makefile. (For some
   reason, the mingw32 distribution includes comctl32.a, but
   fails to include the corresponding header file -- that item
   is still being resolved. For now, V will provide the header.)

5) cd to each of these directories and run `make' for each
   of the following. (The top level Makefile in C:/v has X
   specific stuff and doesn't work. Also, since make is
   case sensitive, you might have to use `make -f makefile'.)

        srcwin		(required)
        appgen		(useful - see documentation)
        iconed		(useful - especially for icons)
        icons		(shows predefined V icons you can use)

        draw		(example only)
        drawex		(example only)
        examp		(example only)
        texted		(example only)
        tutor		(example only)
	vide            (very useful IDE for mingw32!)


6) Putting the V headers in the mingw32 directory path has the
   advantage of eliminating the need for extra include directives in
   your makefiles. (An older version of V found at the mingw32 site
   should be replaced with this latest version.)

   After you build V, you will find it easiest to copy libV.a from
   v/lib/mingw32 to mingw32/lib/libV.a, as well as all the
   V headers in from v/includew/v to mingw32/include/v. This will
   allow you to easily update versions of V, and to compile your
   own applications with V.

   To do this, after you've built the V library, change to the
   home /v directory, and enter:

       make installmingw32

   This will copy all the required header, library, and binary
   files to the mingw32 directories as defined in Config.mk.

7) If you want to build OpenGL applications with mingw32, there
   are may be some problems. The main issue seems to be with the
   header files. If you don't have working OpenGL header files,
   they are available at ftp://objectcentral.com/mingw32.

******* TO COMPILE YOUR OWN APPLICATIONS

Now that you have a working version of V built (and probably
installed on the mingw32 directory path), it is fairly easy
to use and include the V library. The main thing is to
include the required -l switches to g++ to load the proper
libraries. Use:

g++ $(YOUROBJECTS) -lV -lcomctl32 -mwindows

All the libraries needed for Windows are automatically included with the
option -mwindows (you may need to add -lcomctl32).

If you want to add icon resources, see the example vgen.rc file in
the /v/appgen directory. You can replace the .ico file with whatever
icon you want. You then need to add a dependency in your Makefile
to compile the .rc file with windres, and include the resulting
output file on the link line. The Makefile for vgen in /v/appgen
includes an example of how to do this.
