Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt + VTK on Mac OS X 10.6: errors linking projects
Forum Updated to NodeBB v4.3 + New Features

Qt + VTK on Mac OS X 10.6: errors linking projects

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 5.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    msotaquira
    wrote on last edited by
    #1

    Hi!

    I'm UNSUCCESSFULLY trying to build the Qt + VTK examples included in VTK's 5.6.1 distribution (.../VTK/Examples/GUI/Qt/). Here's what I'm using:

    • VTK distribution: 5.6.1
    • Qt IDE: Qt creator 2.7.1 (based on Qt 4.7.0)
    • Mac OS X version: 10.6.6

    Also in the .pro project file on Qt I've included my vtk headers and lib directories:

    @
    INCLUDEPATH += /Users/catamigue/Documents/Migue/Developer/bin/vtk561/include/vtk-5.6
    LIBS += -L/Users/catamigue/Documents/Migue/Developer/bin/vtk561Dyn/lib/vtk-5.6
    @

    Regardless of the example I'm trying to build (Events, GraphicView, ImageViewer or SimpleView), after trying to build the project on Qt creator I always get the same error (in "Build issues" tab on Qt Creator):
    :: error: symbol(s) not found
    :: error: collect2: ld returned 1 exit status

    also from the "compile output" tab I get this after building:

    @
    ld: warning: directory '/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib' following -L not found
    ld: warning: directory '/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib' following -F not found
    Undefined symbols:
    "vtkSmartPointerBase::~vtkSmartPointerBase()", referenced from:
    vtkSmartPointer<vtkRenderer>::~vtkSmartPointer()in simpleview.o
    vtkSmartPointer<vtkCubeSource>::~vtkSmartPointer()in simpleview.o
    vtkSmartPointer<vtkActor>::~vtkSmartPointer()in simpleview.o
    vtkSmartPointer<vtkPolyDataMapper>::~vtkSmartPointer()in simpleview.o
    vtkSmartPointer<vtkSphereSource>::~vtkSmartPointer()in simpleview.o
    "vtkAlgorithm::GetOutputPort(int)", referenced from:
    vtkAlgorithm::GetOutputPort() in simpleview.o
    "vtkActor::New()", referenced from:
    vtkSmartPointer<vtkActor>::New() in simpleview.o
    "vtkSphereSource::New()", referenced from:
    vtkSmartPointer<vtkSphereSource>::New() in simpleview.o
    "QVTKWidget::QVTKWidget(QWidget*, QFlagsQt::WindowType)", referenced from:
    Ui_SimpleView::setupUi(QMainWindow*) in simpleview.o
    Ui_SimpleView::setupUi(QMainWindow*) in simpleview.o
    "vtkRenderer::AddActor(vtkProp*)", referenced from:
    SimpleView::SimpleView()in simpleview.o
    SimpleView::SimpleView()in simpleview.o
    SimpleView::SimpleView()in simpleview.o
    SimpleView::SimpleView()in simpleview.o
    "vtkCubeSource::New()", referenced from:
    vtkSmartPointer<vtkCubeSource>::New() in simpleview.o
    "vtkPolyDataMapper::New()", referenced from:
    vtkSmartPointer<vtkPolyDataMapper>::New() in simpleview.o
    "vtkSmartPointerBase::vtkSmartPointerBase(vtkObjectBase*, vtkSmartPointerBase::NoReference const&)", referenced from:
    vtkSmartPointer<vtkSphereSource>::vtkSmartPointer(vtkSphereSource*, vtkSmartPointerBase::NoReference const&)in simpleview.o
    vtkSmartPointer<vtkCubeSource>::vtkSmartPointer(vtkCubeSource*, vtkSmartPointerBase::NoReference const&)in simpleview.o
    vtkSmartPointer<vtkPolyDataMapper>::vtkSmartPointer(vtkPolyDataMapper*, vtkSmartPointerBase::NoReference const&)in simpleview.o
    vtkSmartPointer<vtkActor>::vtkSmartPointer(vtkActor*, vtkSmartPointerBase::NoReference const&)in simpleview.o
    vtkSmartPointer<vtkRenderer>::vtkSmartPointer(vtkRenderer*, vtkSmartPointerBase::NoReference const&)in simpleview.o
    "vtkRenderer::New()", referenced from:
    vtkSmartPointer<vtkRenderer>::New() in simpleview.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    make: *** [01SimpleView.app/Contents/MacOS/01SimpleView] Error 1
    make: Leaving directory `/Users/catamigue/Documents/Migue/Polimi/Programming/Qt/Learning code/Qt + VTK + ITK/01SimpleView-build-desktop'
    The process "/usr/bin/make" exited with code %2.
    Error while building project 01SimpleView (target: Desktop)
    When executing build step 'Make'
    @

    from what I've read in other forums this might be an error during linking... and I don't know what to do!... Please, some guidance will be really appreciated...

    Also some additional information of how vtk5.6.1 was built on my Mac:

    • CMake version: 2.8.1.
    • CMake parameters (using CMake interface, not command line):

    @
    BUILD_EXAMPLES = OFF
    BUILD_SHARED_LIBS = OFF
    BUILD_TESTING = OFF
    CMAKE_BUILD_TYPE = Release
    CMAKE_OSX_ARCHITECTURE = x86_64
    VTK_USE_GUI_SUPPORT = ON
    VTK_USE_QT = ON
    @

    I've also tried by recompiling VTK with universal binaries (by changing CMAKE_OSX_ARCHITECTURE) and by building the projects in Qt Creator both in Debug and Release modes... And nothing!

    I've also successfully built all of the Qt examples (not including VTK)...

    Any comments?

    Thanks,
    Miguel

    [EDIT: code formatting, Volker]

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      Something with the bundled version of Qt in the SDK/Creator are broken. I'd suggest you download the current version 4.7.1 for Mac from http://qt.nokia.com/downloads (see "this thread": http://developer.qt.nokia.com/forums/viewthread/1103 for some further reading)

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • M Offline
        M Offline
        msotaquira
        wrote on last edited by
        #3

        Hi!

        I've just downloaded and install the current (4.7.1.) version (after completely uninstalling the previous one), and with no success... I'm not getting these:

        ld: warning: directory '/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib' following -L not found
        ld: warning: directory '/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib' following -F not found

        warnings anymore. However I'm still unable of building my Qt+VTK project from Qtcreator (I'm now working with the release candidate 2.1). In the end I get the same errors:

        collect2: ld returned 1 exit status
        make: *** [SimpleView.app/Contents/MacOS/SimpleView] Error 1

        For now I've successfully managed to build the projects with CMake, but I'd still like to do everything from Qt creator, from coding to compiling and building the application.

        Thanks!
        Miguel

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

          You are still using the 4.7.0 version of Qt - the error lines clearly says it.

          You must make the new 4.7.1 version visible to Creator (Settings/Qt 4/Versions - add your newly compiled one) and switch to the new version in your project(s).

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • M Offline
            M Offline
            msotaquira
            wrote on last edited by
            #5

            Hi Volker,

            As I mentioned in my previous post: I'm not getting those warnings (ld: warning: ...) anymore! Version 4.7.1 is already visible to Creator and I've already tried to compile the projects with this latest version.

            However the errors persist:
            collect2: ld returned 1 exit status
            make: *** [SimpleView.app/Contents/MacOS/SimpleView] Error 1

            Thanks again,

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on last edited by
              #6

              Ah, sorry. I overlooked the not.

              Can you switch to the compiler output tab of Creator. There it should mention what is missing, as it is a linker error and it most likely cannot resolve a symbol.

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved