Qt and dlib in ubuntu linking problem
-
@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,
@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 -
@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 -
@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'...
-
@Jimmy32 Can you show your pro file?
Does the dlib depend on other libraries (you can check with ldd)?@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.cppand for ldd i dont have the executable as it cant build...
-
@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.cppand for ldd i dont have the executable as it cant build...
-
@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 -
@jsulm my library is static and i typed
ldd /usr/local/lib/libdlib.abut it gave me " not a dynamic executable "
-
dlib installation and Qt - dlib linking
https://www.youtube.com/watch?v=YkTHq65FPa4