Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt and dlib in ubuntu linking problem
Qt 6.12 LTS is out! See what's new in the release blog

Qt and dlib in ubuntu linking problem

Scheduled Pinned Locked Moved Unsolved General and Desktop
16 Posts 4 Posters 10.4k 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.
  • J Jimmy32

    @SGaist Thank you for your help but after build the Qt project as release to fit my dlib build i got another problem.
    If there is no dlib deep learning network defined in my code, i can build but once i add a dlib network, i got a building error

     /home/jimmy/Desktop/Connected_Robotics_Watson/workco/work/mainWindow.cpp:-1: error: undefined reference to `dlib::cpu::pooling::pooling()'
    

    i am lost... because in a normal cpp code compile with cmake, everything worked well.

    Thanks,

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

    @Jimmy32 You're not linking dlib.
    Try with LIBS/INCLUDEPATH in pro file instead of PKGCONFIG. See http://doc.qt.io/qt-5/qmake-variable-reference.html

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

    J 1 Reply Last reply
    0
    • jsulmJ jsulm

      @Jimmy32 You're not linking dlib.
      Try with LIBS/INCLUDEPATH in pro file instead of PKGCONFIG. See http://doc.qt.io/qt-5/qmake-variable-reference.html

      J Offline
      J Offline
      Jimmy32
      wrote on last edited by
      #7

      @jsulm Thank you
      i have tried this before, i added the lib in the LIBS -ldlib but i got another error

      :-1: error: /usr/local/lib/libdlib.a(cpu_dlib.cpp.o): undefined reference to symbol 'cblas_sscal'
      

      ...

      jsulmJ 1 Reply Last reply
      0
      • J Jimmy32

        @jsulm Thank you
        i have tried this before, i added the lib in the LIBS -ldlib but i got another error

        :-1: error: /usr/local/lib/libdlib.a(cpu_dlib.cpp.o): undefined reference to symbol 'cblas_sscal'
        

        ...

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

        @Jimmy32 Can you show your pro file?
        Does the dlib depend on other libraries (you can check with ldd)?

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

        J 1 Reply Last reply
        0
        • jsulmJ jsulm

          @Jimmy32 Can you show your pro file?
          Does the dlib depend on other libraries (you can check with ldd)?

          J Offline
          J Offline
          Jimmy32
          wrote on last edited by
          #9

          @jsulm my .pro file:

          QT += network
          QT += widgets
          TEMPLATE = app
          TARGET = Connected
          
          
          INCLUDEPATH += /usr/local/include
          LIBS += -L /usr/local/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -ldlib
          QMAKE_CXXFLAGS += -std=c++11
          # PKGCONFIG = dlib-1
          
          
          # Input
          HEADERS += mainWindow.hpp
          SOURCES += main.cpp mainWindow.cpp
          

          and for ldd i dont have the executable as it cant build...

          jsulmJ 1 Reply Last reply
          0
          • J Jimmy32

            @jsulm my .pro file:

            QT += network
            QT += widgets
            TEMPLATE = app
            TARGET = Connected
            
            
            INCLUDEPATH += /usr/local/include
            LIBS += -L /usr/local/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -ldlib
            QMAKE_CXXFLAGS += -std=c++11
            # PKGCONFIG = dlib-1
            
            
            # Input
            HEADERS += mainWindow.hpp
            SOURCES += main.cpp mainWindow.cpp
            

            and for ldd i dont have the executable as it cant build...

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

            @Jimmy32 Remove space between -L and /usr/local/lib
            You don't need the executable. What I meant is:

            ldd /usr/local/lib/dlib.so
            

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

            J 1 Reply Last reply
            0
            • jsulmJ jsulm

              @Jimmy32 Remove space between -L and /usr/local/lib
              You don't need the executable. What I meant is:

              ldd /usr/local/lib/dlib.so
              
              J Offline
              J Offline
              Jimmy32
              wrote on last edited by
              #11

              @jsulm my library is static and i typed

              ldd /usr/local/lib/libdlib.a 
              

              but it gave me " not a dynamic executable "

              jsulmJ 1 Reply Last reply
              0
              • J Jimmy32

                @jsulm my library is static and i typed

                ldd /usr/local/lib/libdlib.a 
                

                but it gave me " not a dynamic executable "

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

                @Jimmy32 Did you remove the space? Don't forget to run qmake afterwards.

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

                J 1 Reply Last reply
                0
                • jsulmJ jsulm

                  @Jimmy32 Did you remove the space? Don't forget to run qmake afterwards.

                  J Offline
                  J Offline
                  Jimmy32
                  wrote on last edited by
                  #13

                  @jsulm yes i did remove but still the same

                  jsulmJ 1 Reply Last reply
                  0
                  • J Jimmy32

                    @jsulm yes i did remove but still the same

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

                    @Jimmy32 My guess is that dlib depends on some other libs you're currently not linking

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

                    J 1 Reply Last reply
                    0
                    • jsulmJ jsulm

                      @Jimmy32 My guess is that dlib depends on some other libs you're currently not linking

                      J Offline
                      J Offline
                      Jimmy32
                      wrote on last edited by
                      #15

                      @jsulm after some search, dlib depends on pthread and x11

                      1 Reply Last reply
                      0
                      • E Offline
                        E Offline
                        Eyyup
                        wrote on last edited by Eyyup
                        #16

                        dlib installation and Qt - dlib linking
                        https://www.youtube.com/watch?v=YkTHq65FPa4

                        1 Reply Last reply
                        1

                        • Login

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