One should first try the basic examples listed below. A pre-compiled version of these is available for evaluation.
New developers should first read the introduction page and the commented example to understand the philosophy of the library.
|
|
|
If you installed the RPM, the examples' source files are in
/usr/share/doc/QGLViewer/examples
and you have to copy the desired example(s)
directories to a place where you have write permission.
If you have downloaded the tarball instead, simply go to the examples
directory. Then,
> cd exampleDirectory > qmake [PREFIX=...] [INCLUDE_DIR=...] [LIB_DIR=...] [QGLVIEWER_STATIC=1] > makeThe optional
PREFIX, INCLUDE_DIR
and LIB_DIR
parameters are those you used
if you customized your make install
. Use
QGLVIEWER_STATIC=1
to link with the static version of the library.
These commands can also be typed in the examples
's main directory to compile all the examples.
You may be prompted with an "error while loading shared libraries"
message when trying
to execute an example. You probably forgot to add the libQGLViewer.so
directory to your
default library path. Simply do this (use LD_LIBRARYN32_PATH
instead on some Unix
flavors):
[bash] > export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/Path/To/libQGLViewer [tcsh] > setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/Path/To/libQGLViewerSome configurations may require you to add
LIBS *= -lXi
in the .pro
file.
Debian users may have to replace -lQGLViewer-2
by -lQGLViewer
(change the
Makefile
or create a link on libQGLViewer.so
in your lib directory).
See also the Qt-Unix and libQGLViewer on Unix installation pages.
The examples' compilation is essentially identical to the one described above in the linux section.
Simply replace the above lines by:
[bash] > export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/Path/To/libQGLViewer [tcsh] > setenv DYLD_LIBRARY_PATH ${DYLD_LIBRARY_PATH}:/Path/To/libQGLViewerYou can safely ignore the prebound warning. Building a prebound library creates overlapping address ranges. This requires further investigations and any help is more than welcome.
A declaration of C function 'void qObsolete' conflicts with previous declaration
error
message may appear during the examples' compilation. This seems to only happen when the include
files are installed in /usr/include
. Easiest patch, install somewhere else !
cd QGLViewer make uninstall qmake INCLUDE_DIR=/usr/local/include (for instance) make installThen compile the examples with the same
qmake INCLUDE_DIR=/usr/local/include
line. Any
cleaner solution is more than welcome.
See also the Qt-Mac and libQGLViewer on Mac installation pages.
Windows users have to compile each example separately, using the Open Qt project * icon. With Visual Studio 6.0, use File-Open workspace to open the
.dsp
generated file.
.pro
files (uncomment and remove end of
file as explained. Remove QT_DLL
from DEFINES
for .NET). If no
Project created
dialog is displayed when you open the .pro
, try to run
Visual with Administrator priviledges. With Qt 2.3, you also have to add /GX /GR
in
Project-Settings-C-C++, Project options before compilation and tune the include and lib
paths:
libQGLViewer-2.0.0
(note there is no trailing QGLViewer
) to your
Project-Properties-C/C++-General-Additional Include Directories *libQGLViewer-2.0.0\QGLViewer
to your
Linker-General-Additional Library Directories *. Visual 6
users may add Release
(or Debug
) to this path: it must be the directoy
where QGLViewer.lib
is located.All this should be done automatically if you use a Qt 3.x version.
See also the installation advices for Qt-Windows and libQGLViewer on Windows..NET | Visual Studio 6 |
---|---|
Open Qt Project | Generate Qt Project |
Project-Properties-C/C++-General-Additional Include Directories | Tools-Options-Directories-Include files |
Project-Properties-Linker-General-Additional Library Directories | Tools-Options-Directories-Library files |