I believe that V is one of the easiest to program GUI frameworks you will find. However, because it has been designed to work on several platforms, each with differing file systems and C++ compilers, getting a working version of V takes a little effort.
Please remember that V is a free package, and is being done completely by volunteers. I am paying for the ObjectCentral web site that is the home of V out of my own pocket. Supporting a program like V takes a lot of time and effort. Mostly I want to spend that effort on improving the library itself. Thus, my philosophy on distribution is to keep the number of downloadable files to a minimum. For the core (X LessTif and MS-Windows) distribution, I've chosen to use gzipped tar files. If you have Linux or other Unix flavor, this is the natural format. If you use MS-Windows, then you can use the popular WinZip program which supports .tgz files, or download Windows versions of tar and gunzip from the ObjectCentral ftp site.
The OS/2 and X gtk version are built by the volunteers that did those ports. I try to let them do what is easiest and best for them.
So, please take the time to read this section carefully. It should have the details you need to get a working version of V for almost any supported platform. If you think there would be a better way, I'd appreciate any volunteer effort you'd like to put into a more automated process, and I'll try to include them on the ObjectCentral web site. Now to the details...
Beginning with V Version 1.21, the V distribution will consist of several parts.
It has been my policy to distribute V only in source format, and not include precompiled versions of the library or applications. There are two reasons for this. First, there are a bunch of C++ compilers out there, and they usually don't work together. It would take just too much effort to try them all. Second, I think getting V to compile with your compiler on your system is a good exercise. If you can get that far, then you should be able to produce a V application with few problems.
However, that said, beginning with Version 1.21, the distribution will also contain ready-to-use compiled versions of the library and V utility applications for the platforms and compilers I have easy access to. Initially, these will include Mingw32 egcs, and perhaps Borland C++ for MS-Windows, and an elf binary for Linux systems. The binary versions will follow some weeks after the source code release! The distributions will be split into three parts: executables for various V utility programs, the V include files, and finally the V library files for each compiler. See the ObjectCentral ftp site for latest binary versions. Instructions for installation of the binary versions are included later in this page.
I think it is appropriate to discuss my general philosophy about the distribution of V, and how Version 1.21 represented a major change. First, it is important to remember that the distribution of V is essentially a one person effort. The X Athena and Motif versions, and the Windows WIN32 versions, as well as the documentation, are currently completely being done by me, Bruce Wampler. The OS/2 is the responsibility of Jon Hacker, and the X gtk version has been done by Sven Verdoolaege (skimo). Thus, there are really three distributions of V.
Nevertheless, I'm still the main focal point of V, and am responsible for the main distribution, and approval of the other releases. Thus, some of the decisions about the distribution have been made to minimize the time I spend on distribution, and maximize the time I spend on adding features. Thus, I don't use an Install program on MS-Windows, and haven't RPM packaged V for Linux. I'd more than welcome any volunteers to do anything to make installation simpler.
Until the 1.21 release, V had been strictly a source code distribution. I've finally decided that is not the best decision. So, beginning with this version, I will provide precompiled binaries for several major compilers and platforms. (Note: the release of the binary versions will follow some time after the source release.) If you successfully build a version of V for one that I haven't provided, please let me know, and I will include your version on the distribution site.
Because of the history as a source only distribution, and because many V users will still have to compile it, this document will still be heavily oriented to telling you how to compile V on your system. If you are lucky enough to use a compiler supported by a binary distribution, then you are in good shape.
I've also been hesitant to consider V a major library on equal status with the standard C++ libraries. Again, I'm changing that idea, and beginning with V 1.21, the general philosophy will be to install V libraries, include files, and utility applications in the same directories used by X applications for X systems, and the main location of includes and libraries for MS-Windows. For most users, this will greatly simplify things. For some, it may mean an interaction with your system administrator to get V properly installed. I'd appreciate feedback on this new approach.
This section describes the directory structure of the V source distribution. The V directory structure has been designed to allow you to either install V in a personal directory, or at a higher system level.
The file hierarchy is:
Believe it or not, all the object code generated by the various compilers available for Windows is incompatible across compilers! This means it is not easy to distribute V already compiled for every compiler available. For one thing, I just can't afford to buy that many compilers.
This incompatibility means two important things. First, you must use a library for V compiled with your compiler. I've tried to supply project or make files required for the major compilers, but not all are available. The binary distribution also has precompiled versions for several major Windows compilers.
Second, when you compile your apps for V, you must be very careful about the compilation model you specify. For Windows 3.1, the best model is usually called Large. (WARNING! V has not been tested with Windows 3.1 since about version 1.16.) While WIN32 doesn't have the memory model problem, it does have calling convention and data alignment problems. You MUST be careful to compile the V library AND your own applications using the same memory model or calling conventions. These options are usually buried somewhere on an options menu. I can't provide exact information about this. It is your job to understand your compiler enough to do this.
I've selected a calling convention for the V project files I provide. You should check what they are, and be sure they match. I don't think they are always the default settings.
For example, the WIN32 version for the Borland compiler requires that word alignment be used. The compiler default is byte, so you will have to change this for your projects. The project examples supplied have generally had their options set as required. You should examine the settings, and use the same ones for your applications. You cannot mix compilers or even compiler code options.
It does seem, however, that you can build your applications with a data alignment bigger than V's. V is built with word alignment, but apparently it is ok to build your apps with 4 byte or 8 byte alignment and use it with the default 2 byte V library.
The standard distribution includes subdirectories for each compiler: Borland (/bccide), Microsoft (/msvc,/msvc6), Watcom (/watcom), and mingw32 (/gnuwin32). For the IDE based versions, you should be able to use the project files to get started. For the mingw32 distribution, please see the section below on mingw32.
The binary distribution is found at ftp://objectcentral.com/bin-dist. The binaries are for the following compilers:
Mingw32 egcs. This was compiled using the latest mingw32 egcs distribution.
Borland C++ 5.01 - This should work with BCC 5.01 and later.
The idea is to use the standard /bin, /include, and /lib directories used by your compiler. The V utility programs (vappgen, vide, etc.) are actually compiled with mingw32/egcs, and should execute with any compiler. The V include files, which belong on .../include/v are also common across all Windows compilers. I've archived and compressed these with tar and gzip. Executables of these two utilities are available on the ObjectCentral ftp site under dosutils if you need them.
Finally, there is a separate version of the compiled static V library for each of the above compilers.
Download v122-win-util.tgz and v122-win-inc.tgz for the common files. Download v122-win-lib-xxx.tgz with the appropriate xxx for your compiler.
Then, copy v122-win-util.tgz to the proper /bin directory. This can actually be any directory in your path, but I think the best convention is to put them on the bin directory of your compiler. Gunzip and untar the file:
cd /wherever/bin gunzip -d v122-win-util.tgz tar -xvf v122-win-util.tar
Copy v122-win-inc.tgz to the /include directory used by your compiler. This directory will contain standard files such as windows.h and stdlib.h. Unpacking the V include files here will produce a subdirectory (.../include/v) for the V include files.
cd /whatever/include gunzip -d v122-win-inc.tgz tar -xvf v122-win-inc.tar
Finally, do the same for the compiled library files.
cd /whatever/lib gunzip -d v122-win-lib-xxxx.tgz tar -xvf v122-win-lib-xxxx.tar
At this point, V should behave like any other library and include file used by your compiler, and will be easy to use. So far, the only special thing V requires is at LEAST word alignment. We've had pretty reliable reports that using 2-word or 4-word alignment will also work for your apps, even with word V libraries.
In my opinion, the best compiler available for Windows is the GNU g++ compiler. There are really two development environments that use the g++ compiler: gnuwin32 and Mingw32. The first is really the Cygnus environment, and uses the cygwin.dll to support many Unix-like functions on windows. The Mingw32 distribution is intended for native Windows development.
I have been using mostly the Mingw32 version to develop V for quite some time now. The latest version is GCC 2.95, which combines the egcs and standard 2.8 gcc compiler. See GNU g++ for mingw32 and cygwin32 by Mumit Khan for the latest info on the Mingw32 compiler.
IMPORTANT NOTE ABOUT GCC 2.95
There is a bug in the commdlg.h file with versions of Mingw32 GCC 2.95 released by Mumit Khan as of August 15, 1999. To fix this, you MUST edit the file C:\mingw32\i386-mingw32\include\commdlg.h and add the two lines noted below (assuming you've installed Mingw32 on C:\mingw32):
#ifndef _COMMDLG_H #define _COMMDLG_H #pragma pack(push,1) // add this for GCC 2.95 #ifdef __cplusplus extern "C" { #endif ... rest of file definitions #ifdef __cplusplus } #endif #pragma pack(pop) // add this for GCC 2.95 #endif
After you have a working version of V built (and probably
installed on the mingw32/egcs directory path), either by
installing the precompiled version or building your own version,
it is fairly easy
to use and include the V library. The main thing is to
use the required -l switches to g++ to load the proper
libraries. Use:
g++ $(YOUROBJECTS) -lV -lcomctl32 -mwindows
-or, for OpenGL apps-
g++ $(YOUROBJECTS) -lV -lVgl -lcomctl32 -mwindows
All the libraries needed for Windows are automatically included with the
option -mwindows (you may also 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.
The default version assumes that you have unpacked the V distribution to c:/v, and that you have installed mingw32 on C:/mingw32. You can change this by editing the copied version of /v/Config.mk.
Currently (August 1999), there remain some issues with the GCC 2.95 release. The problem with commdlg.h is noted above.
You probably will have to do something with commctrl.h. If you are using a GCC version before the latest 2.95 (why are you doing that?), then you MAY need to copy C:/v/gnuwin32/include/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.
Also, if you choose to compile for OpenGL, you may need to copy the entire gl subdirectory (found at v/gnuwin32/include) to the GNU WIN32 include directory (as a /include/gl subdirectory).
After you build V, you will find it easiest to copy libV.a from v/lib 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:
One of the main features of the Cygwin support for the V library is the fact that it may be built for both X and Windows GUI targets.
NOTE: To use the X version you will have to download precompiled library and header files of X11R6.4 from Cygwin32 Porting Project's homepage at http://www-public.rz.uni-duesseldorf.de/~tolj, which is also the official supporter and a X windows server for your Win32 machine, i.e. X-Win32 from http://www.starnet.com.
Now that you have a working version of V built (and probably
installed on the cygwin\bin 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) -s -e _mainCRTStartup -lV -lcomctl32 -mwindows
A similar model line for using the X version of the V library is:
g++ $(YOUROBJECTS) -s -e _mainCRTStartup -L/usr/X11R6.4/lib -lV -lXaw -lXmu -lXt -lXext -lX11 -lICE -lSM
All the libraries needed for Windows are automatically included with the option -mwindows (you may need to add -lcomctl32).
If you want to avoid using the Cygwin DLL, you can also add the -no-cygwin switch, and link to the mingw32 libraries. See the Cygwin documentation for more info. Also check out Mumit Kahn's info.
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.
Please read the file /v/Configs/cygnus-readme.txt for the latest
info on compiling V with Cygwin.
Windows specific files for Borland 5.0 are kept on BCCIDE. That directory includes .IDE files for Borland C++, .RC, .DEF, and .ICO files. The project files assume that BCC is on drive C:. If you have BCC 4.5, or keep BCC on a drive other than C:, then you will have modify the project files to change the include file search paths. Note that the BCC 5.0 project files only work for WIN32. V will no longer be supported for 16 bit compilers.
The subdirectory /v/bccide/vdll contains Borland
makefiles for building a DLL version with Borland C++.
It is VERY easy. See the Readme.txt file.
You use the provided makefiles using a DOS window.
Now you can build V applications using Borland C++, and link
to the V122BCC.LIB, and include the V122BCC.DLL in the same
directory as your executable.
This distribution now includes make/project files for Microsoft
VC++. There are two versions: for
MSVC 4.0, which were built using the cheap Standard Edition, and
can be used with MSVC 5.0 as well; and MSVC 6.0.
Beginning with VC++ 6.0, Microsoft has done things to their
C++ compiler that makes it really have trouble with the existing
V code. The main obnoxious thing they've done is revert to
old style handling of loop variables. I've had to change a bunch
of code to allow default settings to be used.
The following are some of the things required to get V
to compile with MSVC++ 6.0 (These notes are based on using the Standard Edition.
They could be different for the Professional versions. I don't claim
to be an MSVC++ expert, and any better usage notes would be
appreciated.)
Watcom project files are found in the WATCOM directory.
There are various subdirectories with different WIN32 and
Win3.1 project files.
There is a subdirectory called WATCOM11 that has some
contributed makefiles that are known to work with Watcom 11.
Unless I get significant feedback otherwise, I plan to drop
support for Watcom with the next release of V. The supplier
has recently notified all Watcom customers that it is dropping
support for Watcom C++ completely. With the great free GCC 2.95
now available, there is no compelling reason to stick with
old, unsupported software.
If you want to compile V with a different compiler, it isn't
too hard. To build the library, you include ALL the files in
the v/srcwin directory. Specify v/includew in the include
search path. V has been designed to work only with the LARGE
model for Win3.1. It works with whatever calling convention
you need for WIN32.
The djcpp version has difficulty compiling
V. It was never intended to compile Win32 apps, and
so V will not easily compile with djcpp.
Beginning with V Version 1.22, the main widget set supported for
X is Motif/LessTif. Until 1.22, the Athena widget set had been
the main one. However, as of version 0.88, LessTif seems to be
stable enough to fully support V. Since this widget set looks
much better than Athena, and since many Linux distributions are
replacing the standard Athena with Athena3D (which breaks the
look of V Athena), the LessTif version will now be the main
version of V. V will continue to run under Athena, but it is
likely that not all new features will be supported under Athena
(e.g., multiple-list selection when that is added).
Please see the section Motif vs. Athena below.
The default version assumes that you have unpacked the V
distribution to $(HOME)/v, where HOME is the
standard environment variable.
You can change this by editing the copied
version of /v/Config.mk.
After you have a working version of V built (and probably
installed), either by
installing the precompiled version or building your own version,
it is fairly easy
to use and include the V library. The V application
generator, vgen, will build a makefile with the
proper includes and library switches. You can also use the
provided sample makefiles as starting points.
You can also build your own makefiles.
The main thing is to
use the required -l, -L, and -I switches to g++ to load the proper
libraries and include files. To compile, use:
A series of Makefiles is included with the
V distribution
to build the library on various Unix systems. In the main
/v directory is a file called Config.mk which
usually needs to be customized before building. The prototype
Config.mk files are contained in the subdirectory
/v/Configs.
There
are two versions of Config.mk supplied: ConfigX.mk
for the Athena widget based version, and ConfigM.mk
for the Motif widget based version. Before you compile, you
should copy the appropriate file to /v/Config.mk, edit it
to customize it for your system, then type make
from the /v directory. This will build the V
library and all the utility programs.
The Config.mk file, and the various Makefiles
contain lots of comments about building
V on your platform.
Please read those files directly for more critical information
about getting
V working on your system.
The gtk version of V is still a separate distribution.
Please see the instructions included with it. It will eventually
become the mainline V Linux distribution.
Beginning with V 1.22, LessTif will become the standard widget
set supported by V. You must have at least LessTif version
0.88 to work with V, however. You also may be able to use a
standard Motif library, but I've gotten mixed reports that
V doesn't work correctly with real Motif libs.
I know I said I would provide minimal LessTif/Motif support in the
V 1.21 release, but I've changed my mind. First, LessTif 0.88
looks pretty stable. I've finally been able to chase down all but
a couple of problems (visual, not functional) with LessTif.
Programs built using this version look much better,
and work better with the current X Window Managers (KDE specifically).
And some late versions of Linux (Caldera, for example) provide
the 3D Athena library by default, which ruins the look of V/Athena.
Directions for compiling on OS/2 are included in the OS/2
distribution. Since the OS/2 version was just released,
there are not as many prebuilt project or makefiles
available. The mingw32 files should serve as a good
basis for the EMX compiler. As users contribute
feedback, this situation should change.
V will only work with OpenGL if you have it installed
on your system. Beginning with V 1.21, OpenGL support
has been split into a separate library file. This may cause
some compilation errors from V makefiles if you don't have
OpenGL, but you can ignore them.
Windows comes standard with the OpenGL DLL. You must have
the appropriate import library to use the DLL, which usually
comes with the various compilers. The only problem seems to
be with the gnu mingw32/cygwin compiler. The required include
files are available under the /v/gnuwin32 directory
if you need them.
V seems to work flawlessly with Mesa on Linux, and
with standard OpenGL on most other systems. Note that you
must have the Motif or Athena OpenGL widget library (libGLw) built
and available. If you don't have
OpenGL or Mesa, you won't need libVgl.a.
My goal is to get as many people as can be helped using
V. If the terms of this documentation copyright are
unsatisfactory, please contact me and we can probably work something out.
Bruce E. WamplerMicrosoft Visual C++
Watcom
Other Compilers
X Windows
Building V for various X Windows flavors of Unix system
uses the standard gnu version of the Unix make tool.
(Note: you must use a make compatible with the gnu
version of make. The V makefiles use features
and conventions supported by the gnu version. Some native
makes do not support all the features, and will generate
error messages.)
The main /v
directory contains a Makefile and a file called
Config.mk. The directory /v/Configs contains
several versions of Config.mk that usually must be
customized to build
V for your system. The Makefile and the
Config.mk files contain more information about building
V.
Linux
Instructions for building V for Linux
How to compile your own Applications
g++ $(YOURSRC) -I/usr/X11R6/include
To link, use for LessTif/Motif:
g++ $(YOUROBJECTS) -L/usr/X11R6/lib -lV -lXm -lXmu -lXt -lXext -lX11
or for Athena
g++ $(YOUROBJECTS) -L/usr/X11R6/lib -lV -lXaw -lXmu -lXt -lXext -lX11
For OpenGL applications, add -lVgl -lGLw -lGLU -lGL to the library switches.
Other Unix Flavors
gtk
Motif vs. Athena
OS/2
OpenGL
OpenGL on Microsoft Windows
OpenGL on X Windows
This user guide, installation, and reference manual,
The V C++ GUI Framework User Guide and Reference Manual,
Version 1.22, may be reproduced and
distributed, in whole or in part, subject to the following conditions:
V User Guide and Reference Manual - Version 1.22 - 15Aug99
Copyright © 1998,1999, Bruce E. Wampler
All rights reserved.
521 Springridge Dr.
Glenwood Springs, CO 81601
bruce@objectcentral.com
www.objectcentral.com