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. error: undefined reference to `QVTKWidget::QVTKWidget(QWidget*, QFlags<Qt::WindowType>)'
QtWS25 Last Chance

error: undefined reference to `QVTKWidget::QVTKWidget(QWidget*, QFlags<Qt::WindowType>)'

Scheduled Pinned Locked Moved Unsolved General and Desktop
vtkqt5.15.2pcl
10 Posts 4 Posters 2.4k Views
  • 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.
  • S Offline
    S Offline
    surajj4837
    wrote on last edited by surajj4837
    #1

    I m using Qt5.15 in Ubuntu 20.04. I want to use PCL to visualise point cloud data. To get PCL runnig with Qt, VTK library is also required. So in my system I have PCL 1.10 and VTK 7.1.1. I have taken sample code for testing the setup from here. I m getting following error:

    error: undefined reference to `QVTKWidget::QVTKWidget(QWidget*, QFlags<Qt::WindowType>)'
    

    Any suggestion for resolving this?

    jsulmJ 1 Reply Last reply
    0
    • S surajj4837

      I m using Qt5.15 in Ubuntu 20.04. I want to use PCL to visualise point cloud data. To get PCL runnig with Qt, VTK library is also required. So in my system I have PCL 1.10 and VTK 7.1.1. I have taken sample code for testing the setup from here. I m getting following error:

      error: undefined reference to `QVTKWidget::QVTKWidget(QWidget*, QFlags<Qt::WindowType>)'
      

      Any suggestion for resolving this?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @surajj4837 said in error: undefined reference to &#x60;QVTKWidget::QVTKWidget(QWidget*, QFlags<Qt::WindowType>)':

      Any suggestion for resolving this?

      Link against the VTK library

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      S 1 Reply Last reply
      2
      • A Offline
        A Offline
        Anonymous_Banned275
        wrote on last edited by
        #3

        This could be a good time to take a look at Qt SUB_DIRS.
        It does most of the grunt work for you.
        It manages library source code , links to library...
        However you still have to add source reference (include header) to
        your library. Lack of it gives you "undefined reference " error.

        SUB_DIRS even lets you reuse existing code - importing from github.

        1 Reply Last reply
        0
        • jsulmJ jsulm

          @surajj4837 said in error: undefined reference to &#x60;QVTKWidget::QVTKWidget(QWidget*, QFlags<Qt::WindowType>)':

          Any suggestion for resolving this?

          Link against the VTK library

          S Offline
          S Offline
          surajj4837
          wrote on last edited by surajj4837
          #4

          @jsulm I followed steps given here for building vtk8.1.0 and linking it with Qt.

          1 Reply Last reply
          0
          • Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @surajj4837 said in error: undefined reference to &#x60;QVTKWidget::QVTKWidget(QWidget*, QFlags<Qt::WindowType>)':

            and linking it with Qt.

            This link never tells you anything how to link against the VTK library. See qmake documentation on how to link against libs: LIBS
            And forget about SUB_DIRS - it's not needed here at all (aart from the fact that even the name is wrong - it's SUBDIRS)

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            S 1 Reply Last reply
            1
            • Christian EhrlicherC Christian Ehrlicher

              @surajj4837 said in error: undefined reference to &#x60;QVTKWidget::QVTKWidget(QWidget*, QFlags<Qt::WindowType>)':

              and linking it with Qt.

              This link never tells you anything how to link against the VTK library. See qmake documentation on how to link against libs: LIBS
              And forget about SUB_DIRS - it's not needed here at all (aart from the fact that even the name is wrong - it's SUBDIRS)

              S Offline
              S Offline
              surajj4837
              wrote on last edited by
              #6

              @Christian-Ehrlicher I m using cmake build system.

              1 Reply Last reply
              0
              • Christian EhrlicherC Offline
                Christian EhrlicherC Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Then take a look at find_library and target_link_libraries... There are enough examples out there for cmake.

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                1 Reply Last reply
                1
                • S Offline
                  S Offline
                  surajj4837
                  wrote on last edited by
                  #8

                  I think the problem is, I m copying the libQVTKWidgetPlugin.so in /plugins/designer/ directory of Qt but the qt creator is not able to recognize it.

                  jsulmJ 1 Reply Last reply
                  0
                  • S surajj4837

                    I think the problem is, I m copying the libQVTKWidgetPlugin.so in /plugins/designer/ directory of Qt but the qt creator is not able to recognize it.

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    @surajj4837 If it is a plug-in for QtCreator then you need to copy it to the QtCreator plugin folder.

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      surajj4837
                      wrote on last edited by surajj4837
                      #10

                      Official doc says libQVTKWidgetPlugin.so is required to be copied to plugins/designer directory, I have seen many setup tutorial pages which convey the same like this and this.

                      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