PDA

View Full Version : vtk 6 and qt4



mik_a
28th July 2013, 13:48
Hi all ,I'm new to qt programming and qtcreator as well .I have been trying for the past few days to integrate qt with vtk 6 but with no success.I have built vtk 6 as per the instructions on the website but cannot be able to link it with the qt creator .Here's what I have done . I added the QVTKwidget on an empty form just to see whether it would compile but instead got linker file not found errors.I believe its the pro file configuration settings but i just don't know what to do and i've ran out of ideas.Here's what my .pro file looks like


QT += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = vtktest
TEMPLATE = app


SOURCES += main.cpp\
mainwindow.cpp

HEADERS += mainwindow.h

FORMS += mainwindow.ui

win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../usr/local/lib/release/ -lvtkalglib-6
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../usr/local/lib/debug/ -lvtkalglib-6
else:unix: LIBS += -L$$PWD/../../../../usr/local/lib/ -lvtkalglib-6

INCLUDEPATH += $$PWD/../../../../usr/local/include/vtk-6.0
DEPENDPATH += $$PWD/../../../../usr/local/include/vtk-6.0

I only linked to one lib file for illustration as there are many files using the addLibrary->externalLibrary..... method from qtCreator but i still get this error from the compile output although the file is clearly there .


/usr/bin/qmake -spec /usr/share/qt4/mkspecs/linux-g++ CONFIG+=debug CONFIG+=declarative_debug -o Makefile ../vtktest/vtktest.pro
g++ -o vtktest main.o mainwindow.o moc_mainwindow.o -L/usr/lib -L/home/michael/code/vtktest/../../../../usr/local/lib/ -lvtkalglib-6 -lQtGui -L/usr/lib -L/usr/X11R6/lib -lQtCore -lpthread
/usr/lib/gcc/i586-suse-linux/4.7/../../../../i586-suse-linux/bin/ld: cannot find -lvtkalglib-6
collect2: error: ld returned 1 exit status
make: *** [vtktest] Error 1
15:39:29: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project vtktest (kit: Desktop)
When executing step 'Make'

ChrisW67
28th July 2013, 23:33
On my Linux build the library name is "vtkalglib-6.0" not "vtkalglib-6"
The actual library file names are;


$ ls lib/libvtkalglib*
lib/libvtkalglib-6.0.so lib/libvtkalglib-6.0.so.1

mik_a
29th July 2013, 08:26
Thanks for your reply but after a lot trying and not succeeding i have decided to default to the vtk 5 version which is working perfectly