libQGLViewer installation
windows Windows

Select your configuration in this list:
    » Visual Studio
    » MinGW and the free Qt4 version
    » Qt version 2.3
    » Cygwin linux emulator
See also details on the QGLViewer designer plugin installation.
Qt can be downloaded from the Trolltech web site.

Compilation and installation using Visual Studio

These instructions are for Qt version 3 or 4. They require a Qt integration into Visual Studio (available with the commercial Qt license): see the Tools Add-In manager * menu. You can also patch the open source Qt4 version as is detailed here.

To create a static version of the QGLViewer library, add QGLVIEWER_STATIC=yes at the beginning of the .pro file before you open it.

If your Qt version is lower than 3.1, you have to install the GLUT library in order to have text display. Add the paths to GLUT in your Include and Library Project-Properties*, and copy glut32.dll in a library directory (as detailed 6 above).

* Names are given in .NET standards, and differ from those of Visual 6. Here is a correspondence table:

.NETVisual Studio 6
Tools - Add-Ins manager - QtNetTools - Customize - Add-ins and Macro Files/QMsDev Add in
Open Qt ProjectGenerate Qt Project
QGLViewer224.dllQGLViewer2.dll or QGLViewer.dll
Project-Properties-C/C++-General-Additional Include DirectoriesTools-Options-Directories-Include files
Project-Properties-Linker-General-Additional Library DirectoriesTools-Options-Directories-Library files

Compilation and installation using MinGW

MinGW is the windows port of the GNU g++ compiler. It can optionally be installed with the free open source Qt 4 version as is detailed in these instructions.

The installation procedure is very similar to the one detailed in the linux section. Download and unzip libQGLViewer-2.2.4-1.zip and then use the "Qt 4.x command prompt" installed in the Start menu and type:

cd \path\to\libQGLViewer-2.2.4-1\QGLViewer
qmake
make
Copy the resulting dll (created in the Release directory) to a system shared directory such as C:\WINDOWS\system32 (or C:\WINNT\system32 with Windows 2000). Alternately, you can copy it to every application directory. Use qmake "QGLVIEWER_STATIC=yes" to create a static library instead.

Use the same procedure to compile the examples (the resulting .exe is created in the Release directory as well):

cd ..\examples\anyExampleDirectory
qmake
make

Using the free Qt 2.3 version

The free Qt 2.3 version is no longer supported by Trolltech, and it does not give a correct picture of the actual Qt functionalities. libQGLViewer is however fully functional with this Qt version. Note that Qt should not be installed in a directory whose name contains spaces (such as Program Files). You also need to download and install the GLUT library as explained above.

To compile with Qt 2.3, follow the installation procedure described above but open QGLViewer.Qt2.3.pro instead.

With Visual Studio 6:

Compilation and installation using cygwin

An other option is to install the cygwin linux emulator, with the Qt-KDE port. This was successfully tested, although Qt had to be recompiled. You may also have to remove thread from the CONFIG line in QGLViewer.pro.

Then compile QGLViewer as explained in the Unix installation page. You should rename the generated cygQGLViewer-1.dll file to libQGLViewer.dll and copy it in the C:\WINDOWS\system32 directory. Note that cygqt-3.dll and cygqui-1.dll (located in $(QTDIR)/bin or $(QTDIR)/lib) should also be copied in that directory. Thanks Jean-Gui for these details.

Qt   Qt installation

The latest Qt 4 version is available for free for open source development. It comes with the MinGW compiler that can be used with the Dev-C++ IDE. Use these unofficial patches to integrate it into Visual Studio.

The Qt 2.3 version can also be used (see patches for .NET integration).

Visual Studio 6 users must check the Tools/Customize/Add-ins and Macro Files/QMsDev Add in box.

Qt Installation of the designer plugin

The compilation and installation of the QGLViewer designer plugin is optional. Such a plugin eases the creation of user interfaces that feature a QGLViewer using designer. It makes a QGLViewer icon appear in the designer's Display widget tab, as a standard Qt widget:

        Designer plugin

When added to your user interface, the widget displays the standard spiral, which can be manipulated when you test your interface (using Ctrl+T or Ctrl+R with Qt 4). All the viewers' signals and slots are available and can be connected to the rest of your interface.

To compile the plugin, open the designerPlugin.pro file to create your workspace. Compile and install the resulting plugin library in $QTDIR\plugins\designer and/or C:\Program Files\Trolltech\Qt VS Integration\plugins to use it with Visual Studio integrated designer (may require administrator privileges). Note that you also have to install the QGLViewer dll in system32 (as described above). Note that this procedure seems to not be sufficient on certain configurations, any explanation is more than welcome.

Start from this code to create your own designer plugin for your derived QGLViewer classes. See the code of the plugin for details.

With Qt version 3, an alternative to this plugin is to add a "Custom Widget" using the Tools/Custom designer menu. Select Load Descriptions... and provide the qglviewer.cw custom widget description file, located in the QGLViewer header files directory. You can customize this description with your own signals and slots and change the header file path.

See the interface example for an illustration of a user interface that includes a QGLViewer.

Please let me know if you encounter installation problems.

Valid XHTML 1.0! Valid CSS! Last modified on Tuesday, November 28, 2006.