Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. DeclarativeSurface - undefined reference
Qt 6.11 is out! See what's new in the release blog

DeclarativeSurface - undefined reference

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
2 Posts 1 Posters 626 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.
  • Tom assoT Offline
    Tom assoT Offline
    Tom asso
    wrote on last edited by
    #1

    I am building an application that utilizes the undocumented DeclarativeSurface class, but having link problems. DeclarativeSurface is defined in 5.14.2/Src/qtdatavis3d/src/datavisualizationqml2/declarativesurface_p.h. I see DeclarativeSurface code in library qml/QtDataVisualization/libdatavisualizationqml2.so, e.g. with the Linux 'nm' command I see the constructor in that library:

    0000000000027c70 t QtDataVisualization::DeclarativeSurface::DeclarativeSurface(QQuickItem*)
    
    

    Here is a simple test program dvtest.cc:

    #include "datavisualizationqml2/declarativesurface_p.h"
    
    int main(int argc, char **argv) {
      QtDataVisualization::DeclarativeSurface *surface =
        new QtDataVisualization::DeclarativeSurface(nullptr);
    
      return 0;
    }
    

    However when I link the test I get "undefined reference" to the DeclarativeSurface constructor:

    g++ -o dvtest -I ~/Qt5.14.2/5.14.2/Src/qtdatavis3d/src -I ~/Qt/5.14.2/Src/qtdatavis3d/include/QtDataVisualization/5.14.2//QtDataVisualization/private/ -I ~/Qt/5.14.2/Src/qtbase/include/ -I ~/Qt/5.14.2/gcc_64/include  -I ~/Qt/5.14.2/gcc_64/include/QtDataVisualization/ -fPIC dvtest.cc ~/Qt/5.14.2/gcc_64/qml/QtDataVisualization/libdatavisualizationqml2.so /home/oreilly/Qt/5.14.2/gcc_64/lib/libQt5Quick.so /home/oreilly/Qt/5.14.2/gcc_64/lib/libQt5DataVisualization.so /home/oreilly/Qt/5.14.2/gcc_64/lib/libQt5Gui.so /home/oreilly/Qt/5.14.2/gcc_64/lib/libQt5QmlModels.so /home/oreilly/Qt/5.14.2/gcc_64/lib/libQt5Qml.so /home/oreilly/Qt/5.14.2/gcc_64/lib/libQt5Network.so /home/oreilly/Qt/5.14.2/gcc_64/lib/libQt5Core.so 
    /tmp/cc5SCIgN.o: In function `main':
    dvtest.cc:(.text+0x28): undefined reference to `QtDataVisualization::DeclarativeSurface::DeclarativeSurface(QQuickItem*)'
    collect2: error: ld returned 1 exit status
    

    Anyone know why this is?
    Thanks!

    1 Reply Last reply
    0
    • Tom assoT Offline
      Tom assoT Offline
      Tom asso
      wrote on last edited by
      #2

      The 'nm' man page indicates that a lower case 't' indicates a function that's "local" to the library - all of the DeclarativeSurface symbols in that library are marked with 't'. How can I find accessible global functions (that I can use) invoke DeclarativeSurface methods?

      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