libQGLViewer installation
mac Unix systems linux

» Installation on Mac: libQGLViewer and Qt
» Installation on Linux and Unix: libQGLViewer and Qt
» QGLViewer designer plugin installation
» Troubleshooting

mac Mac OS X

Download and decompress the sources, then open the libQGLViewer-2.9.1/QGLViewer folder.

Using Qt Creator

Open and "build all".

Using Xcode

Create the Xcode project by running these lines in a terminal:
cd path/to/libQGLViewer-2.9.1/QGLViewer
qmake -spec macx-xcode

Using make

cd path/to/libQGLViewer-2.9.1/QGLViewer
qmake -spec macx-g++
See the Linux section for details and install paths customization.

Next steps

Once the library is compiled, you can compile the examples.

Install the libQGLViewer designer plugin to easily create user interfaces that integrate a QGLViewer using designer.

You can make install to install the documentation in /Developer/Documentation/QGLViewer.

A Framework is created by default. Uncomment a line in if you want to create a .dylib instead.

mac   Qt   Qt installation on Mac

Install Qt from the nokia web site. Then use the provided Qt Creator or download Xcode from the apple web site.

linuxLinux and Unix

Download and decompress the sources, then go to the libQGLViewer-2.9.1/QGLViewer folder.
tar -xzf libQGLViewer-2.9.1.tar.gz
cd libQGLViewer-2.9.1/QGLViewer

Using Qt Creator

Open and "build all". Optionaly make install to install the application system wide.

Using make

qmake (see options below)
sudo make install [optional]
The following files are installed (you need root privileges to install, since these are system directories): Optional qmake parameters let you customize your make install target installation directories:

A typical usage would be qmake PREFIX=$HOME. Default values are:
- Param -      - Default value -
PREFIX         /usr
LIB_DIR        PREFIX/lib
DOC_DIR        PREFIX/share/doc
The QGLVIEWER_STATIC=yes option will compile a static version of the library.
If your Qt version is lower than 3.1, you need to link with the glut library: uncomment a line in as explained there. glut can be installed from the freeglut-devel rpm or using apt-get install libglut3-dev.

Next steps

Once the library is compiled, you can compile the examples.

You may also want to install the libQGLViewer designer plugin to easily create user interfaces that integrate a QGLViewer using designer.

linux   Qt   Qt installation on Linux

Qt is probably already installed on your machine, or available on your distribution's repository. You may however have to install the dev development package. You can also directly download it.

Try to compile a simple Qt example and check the Qt FAQ page in case of problems. Consider compiling one of the Qt OpenGL examples to test your configuration.

Qt Installation of the designer plugin

The designer plugin installation is optional. It eases the creation of user interfaces that feature a QGLViewer using Qt's designer. It adds a QGLViewer entry in the designer's Display Widgets tab:

        Designer plugin

When added to your interface, the widget displays the standard spiral, which can be manipulated when you test it. All the viewers' signals and slots are available and can be connected to your interface.

Edit the qglviewerPlugin code as indicated to create a similar designer plugin for your derived QGLViewer class.

To compile and install the designer plugin, simply do:
cd designerPlugin
make install
The designerPlugin directory is located in the tarball root directory or in /usr/include/QGLViewer/designerPlugin if you installed QGLViewer from the RPM.

By default, the plugin is installed in $QTDIR/plugins/designer which is usually a system directory. The make install step hence requires root privileges. With Qt4, you can customize the plugin installation path using the qmake PREFIX=... syntax instead. Do not forget to add this path to your QT_PLUGIN_PATH variable so that designer can find the plugin.

Note that needs to be found by designer in order to load the plugin. If you didn't make install the library, add the path to the .so (resp .dylib with Mac) in your LD_LIBRARY_PATH (resp. DYLD_LIBRARY_PATH) as explained in the Qt installation sections above. See the interface example for an illustration of a Qt user interface that includes a QGLViewer.


Here are some error messages that you may encounter with their solutions:

Please let me know if you encounter specific installation problems.

Valid XHTML 1.0! Valid CSS! Last modified on Thursday, December 29, 2022.