[vtkusers] vtkQGL, editing source code required?

George Kamucha kamucha at hfm.e-technik.uni-kassel.de
Tue Aug 14 05:47:23 EDT 2001


Hi Fabian,
That was it, with qt 2.3.0 and vtk 3.1.2, the compilation of the vtkQGL_vtk31 was almost perfect! I had to add
-pthread -ldl in the GL_LIBS. Only one example, showSurface.cpp, didn't get compiled and it is to do with the
non-compatibility of the vtk version which Ehrhardt had used in writing the code. With a bit of optimization, I
will now be able to use the ideas from the code to develop my own GUI. I am very grateful to your invaluable
tips, thanks a lot!

Regards
George

Fabian Eilers wrote:

> Hi !!
>
> There is a failure in the "moc-compilation". Qt uses this for their SIGNAL-SLOT-Konzept.
> But I don't realize where...
>
> Which compiler do you use ? Try another. Perhaps it works.
>
> Try another qt-Version. I prefer qt 2.3.0, because you don't have the qgl-Library anymore.
> But take a look at the attachments.
>
> I have no other ideas. Sorry. It's "try and error".
>
> On a SGI you must have the right order:
> - the include pathes first -> I..../vtk312/common, then /graphics, then /imaging, then /contrib, then
> /patented
> - then the libraries in same order -> L..../vtk312/common -lVTKCommon, and so on...
>
> I sent the Makefile of my compilation as attachment. It works.
>
> Greetings
> Fabian
>
> George Kamucha wrote:
>
> > Hi Fabian,
> > I downloaded vtk 3.1.2, compiled it and that did part of the trick, the installation of the
> > vtkQGL31 sources was successful! But I have spent the last 26 hours or so trying to figure out why
> > the compilation fails in the examples' directory. I am at my wits' ends and please if you have an
> > idea about this error, please let me know, I will really appreciate. I am using qt 2.1.0 and I had
> > thought I had set all the paths properly but something is definitely not right. Here is one of the
> > the error messages I am getting:
> >
> > make[1]: Entering directory '/home/kamucha/vtkQGL31/examples'
> > g++ -o simpleTest simpleTest.o -L../lib -L/usr/lib/qt/lib -L/home/kamucha/vtk312unix/vtk31/../lib
> > -L/usr/X11R6/lib
> > -lVTKQGL -lqgl -lqt -lVTKContrib -lVTKGraphics -lVTKPatented -lVTKImaging -lVTKCommon -lVTKGraphics
> >
> > -lGL -lX11 -lXt -lXmu -lXext -lm -lstdc++
> > ../lib/libVTKQGL.a(moc_vtkQGLWidget.o): in function 'vtkQGLWidget::initMetaObject(void)':
> > moc_vtkQGLWidget.o(.text+0x1c): undefined reference to 'QGLWidget::className(void)const'
> > .........................................................................................................
>
>   ------------------------------------------------------------------------
>
> #
> CFLAGS = -g -fullwarn -woff 1681,1375
> #CFLAGS = -O2 -fullwarn -woff 1681,1375
> LIBCFLAGS =
> YACCCFLAGS = -woff 3262,3203
> LFLAGS =
> CC = CC
> SHELL = /bin/sh
>
> LIBPREFIX = lib
> LIBNAME = VTKQGL
> LIBSUFFIX = .a
>
> #------------------------------------------------------------------------------
> # user-editable QT - defines.
> QTDIR = /opt/local/qt-2.3.0
>
> MOC = $(QTDIR)/bin/moc
>
> QT_INCL    = -I$(QTDIR)/include
> QT_LDFLAGS = -L/opt/local/qt-2.3.0/lib
> QT_LIBS    = -lqt
>
> #------------------------------------------------------------------------------
> # user-editable VTK - defines.
>
> VTK_CXX_FLAGS   = -DVTK_WORDS_BIGENDIAN \
>                         -DVTK_USE_PTHREADS \
>                         -D_HP_NO_FAST_MACROS -DHAVE_LIMITS_H -DHAVE_UNISTD_H
> TOOLKIT_FLAGS    =  -DVTK_USE_GRAPHICS -DVTK_USE_IMAGING \
>                         -DVTK_USE_PATENTED -DVTK_USE_CONTRIB
> GRAPHICS_FLAGS   =  -DVTK_USE_GLR -DVTK_USE_OGLR
>
> VTKDIR          = /opt/local/vtk312
> VTK_FLAGS       = ${VTK_CXX_FLAGS} ${TOOLKIT_FLAGS} ${GRAPHICS_FLAGS}
> VTK_INCL        = -I${VTKDIR}/common -I${VTKDIR}/graphics \
>                         -I${VTKDIR}/patented -I${VTKDIR}/imaging \
>                         -I${VTKDIR}/contrib
>
> VTK_LDFLAG      = -L$(VTKDIR)/lib
> VTK_LIBS        = -lVTKContrib -lVTKGraphics -lVTKPatented \
>                   -lVTKImaging -lVTKCommon -lVTKGraphics
> #------------------------------------------------------------------------------
> # user-editable GL - defines.
> # Include path and libraries for Mesa.
> # For SGI OpenGL: replace MesaGL with GL and MesaGLU with GLU.
> GL_INCL = -I/usr/include
> GL_LDFLAG =
> GL_LIBS = -lGL -lX11 -lXt -lXmu -lXext -lm -lpthread
>
> #------------------------------------------------------------------------------
> #
>
> INCL   = -I../src $(QT_INCL) $(VTK_INCL) $(GL_INCL)
>
> LFLAGS = -L../lib $(QT_LDFLAGS) $(VTK_LDFLAG) $(GL_LDFLAG)
> LIBS   = $(QT_LIBS) $(VTK_LIBS) $(GL_LIBS)
> #-lgl
>
> ###### Implicit rules
>
> .SUFFIXES: .cpp .C
>
> .cpp.o:
>         $(CC) -c $(CFLAGS) $(VTK_FLAGS) $(INCL) -o $@ $<
>
> .C.o:
>         $(CC) -c $(CFLAGS) $(VTK_FLAGS) $(INCL) -o $@ $<
>
>   ------------------------------------------------------------------------
>
> #
> CFLAGS = -O2
> #LIBCFLAGS =
> #YACCCFLAGS =
> #LFLAGS =
> CC = g++
> SHELL = /bin/sh
>
> LIBPREFIX = lib
> LIBNAME = VTKQGL
> LIBSUFFIX = .a
>
> #------------------------------------------------------------------------------
> # user-editable QT - defines.
> QTDIR = /usr/lib/qt
>
> MOC = $(QTDIR)/bin/moc
>
> QT_INCL    = -I$(QTDIR)/include
> QT_LDFLAGS = -L/opt/qt/lib
> QT_LIBS    = -lqgl -lqt
>
> #------------------------------------------------------------------------------
> # user-editable VTK - defines.
>
> VTK_CXX_FLAGS   = -DVTK_WORDS_BIGENDIAN \
>                         -DVTK_USE_SPROC \
>                         -D_HP_NO_FAST_MACROS -DHAVE_LIMITS_H -DHAVE_UNISTD_H
> TOOLKIT_FLAGS    =  -DVTK_USE_GRAPHICS -DVTK_USE_IMAGING \
>                         -DVTK_USE_PATENTED -DVTK_USE_CONTRIB
> GRAPHICS_FLAGS   =  -DVTK_USE_GLR -DVTK_USE_OGLR
>
> VTKDIR          = /usr/vtk/vtk312/
> VTK_FLAGS       = ${VTK_CXX_FLAGS} ${TOOLKIT_FLAGS} ${GRAPHICS_FLAGS}
> VTK_INCL        = -I${VTKDIR}/common -I${VTKDIR}/graphics \
>                         -I${VTKDIR}/patented -I${VTKDIR}/imaging \
>                         -I${VTKDIR}/contrib
>
> VTK_LDFLAG      = -L$(VTKDIR)/lib
> VTK_LIBS        = -lVTKContrib -lVTKGraphics -lVTKPatented \
>                   -lVTKImaging -lVTKCommon -lVTKGraphics
> #------------------------------------------------------------------------------
> # user-editable GL - defines.
> # Include path and libraries for Mesa.
> # For SGI OpenGL: replace MesaGL with GL and MesaGLU with GLU.
> GL_INCL = -I/usr/include
> GL_LDFLAG = -L/usr/X11R6/lib
> GL_LIBS = -lMesaGL -lX11 -lXt -lXmu -lXext -lm -lstdc++
>
> #------------------------------------------------------------------------------
> #
>
> INCL   = -I../src $(QT_INCL) $(VTK_INCL) $(GL_INCL)
>
> LFLAGS = -L../lib $(QT_LDFLAGS) $(VTK_LDFLAG) $(GL_LDFLAG)
> LIBS   = $(QT_LIBS) $(VTK_LIBS) $(GL_LIBS)
>
> ###### Implicit rules
>
> .SUFFIXES: .cpp .C
>
> .cpp.o:
>         $(CC) -c $(CFLAGS) $(VTK_FLAGS) $(INCL) -o $@ $<
>
> .C.o:
>         $(CC) -c $(CFLAGS) $(VTK_FLAGS) $(INCL) -o $@ $<

--
=======================================
George Kamucha
Fachgebiet Hochfrequenztechnik(FB 16),
Universität Kassel,
Wilhelmshöher Allee 73,
Kassel, Germany.
__________________________________________________________________________
Phone : +49 -561-804 6509 (Office); +49 -561-870 5662 (Resi.)
Fax   : +49 -561-804 6529 (Office)
URL   : http://www.uni-kassel.de/fb16/hft/mitarbeiter/kamucha/kamucha.html
__________________________________________________________________________






More information about the vtkusers mailing list