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 to understand the philosophy of the library.
|
|
|
If you installed the RPM, the examples' source files are in
/usr/share/doc/QGLViewer/examples
(may have to be copied 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=yes] > makeThe optional
PREFIX, INCLUDE_DIR
and LIB_DIR
parameters are those you used
if you customized your make install
. Use
QGLVIEWER_STATIC=yes
to link with the static version of the library.
These commands can also be typed in the examples
' 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
by -lQGLViewer-2
(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.
If you get a declaration of C function 'void qObsolete' conflicts with previous declaration
or a
template with C linkage
error message, try to install libQGLViewer 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
explanation and 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 two lines 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.2.4
(note there is no trailing QGLViewer
) to your
Project-Properties-C/C++-General-Additional Include Directories *libQGLViewer-2.2.4\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 Qt version 3 or 4. Apply the same options to your own projects if you didn't start them from one of the examples.
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 |