Results 1 to 3 of 3

Thread: vtk 6 and qt4

  1. #1
    Join Date
    Jul 2013
    Posts
    2
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default vtk 6 and qt4

    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 Code:
    1. QT += core gui
    2.  
    3. greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    4.  
    5. TARGET = vtktest
    6. TEMPLATE = app
    7.  
    8.  
    9. SOURCES += main.cpp\
    10. mainwindow.cpp
    11.  
    12. HEADERS += mainwindow.h
    13.  
    14. FORMS += mainwindow.ui
    15.  
    16. win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../usr/local/lib/release/ -lvtkalglib-6
    17. else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../usr/local/lib/debug/ -lvtkalglib-6
    18. else:unix: LIBS += -L$$PWD/../../../../usr/local/lib/ -lvtkalglib-6
    19.  
    20. INCLUDEPATH += $$PWD/../../../../usr/local/include/vtk-6.0
    21. DEPENDPATH += $$PWD/../../../../usr/local/include/vtk-6.0
    To copy to clipboard, switch view to plain text mode 

    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 .

    Qt Code:
    1. /usr/bin/qmake -spec /usr/share/qt4/mkspecs/linux-g++ CONFIG+=debug CONFIG+=declarative_debug -o Makefile ../vtktest/vtktest.pro
    2. 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
    3. /usr/lib/gcc/i586-suse-linux/4.7/../../../../i586-suse-linux/bin/ld: cannot find -lvtkalglib-6
    4. collect2: error: ld returned 1 exit status
    5. make: *** [vtktest] Error 1
    6. 15:39:29: The process "/usr/bin/make" exited with code 2.
    7. Error while building/deploying project vtktest (kit: Desktop)
    8. When executing step 'Make'
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: vtk 6 and qt4

    On my Linux build the library name is "vtkalglib-6.0" not "vtkalglib-6"
    The actual library file names are;
    Qt Code:
    1. $ ls lib/libvtkalglib*
    2. lib/libvtkalglib-6.0.so lib/libvtkalglib-6.0.so.1
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jul 2013
    Posts
    2
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: vtk 6 and qt4

    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

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.