0
votes

I installed libfreenect on Ubuntu 16.04. Then when I added its libraries in Qt, the following error occurred.

I tried adding libusb-1.0. I typed this in the terminal:

pkg-config libusb-1.0 --libs --cflags -I/usr/include/libusb-1.0 -lusb-1.0

  • The .pro file:

    QT += core QT -= gui

    CONFIG += c++11

    TARGET = 1 CONFIG += console CONFIG -= app_bundle

    TEMPLATE = app

    SOURCES += main.cpp

    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../usr/local /lib/release/ -lfreenect_sync else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../usr/local/lib/debug/ -lfreenect_sync else:unix: LIBS += -L$$PWD/../../../usr/local/lib/ -lfreenect_sync

    INCLUDEPATH += $$PWD/../../../usr/local/include DEPENDPATH += $$PWD/../../../usr/local/include

    win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../../usr/local/lib/release/libfreenect_sync.a else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../../usr/local/lib/debug/libfreenect_sync.a else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../../usr/local/lib/release/freenect_sync.lib else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../../usr/local/lib/debug/freenect_sync.lib else:unix: PRE_TARGETDEPS += $$PWD/../../../usr/local/lib/libfreenect_sync.a

    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../usr/local/lib/release/ -lfreenect_sync else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../usr/local/lib/debug/ -lfreenect_sync else:unix: LIBS += -L$$PWD/../../../usr/local/lib/ -lfreenect_sync

    INCLUDEPATH += $$PWD/../../../usr/local/include DEPENDPATH += $$PWD/../../../usr/local/include

    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../usr/local

    /lib/release/ -lfreenect else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../usr/local/lib/debug/ -lfreenect else:unix: LIBS += -L$$PWD/../../../usr/local/lib/ -lfreenect

    INCLUDEPATH += $$PWD/../../../usr/local/include DEPENDPATH += $$PWD/../../../usr/local/include

    win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../../usr/local/lib/release/libfreenect.a else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../../usr/local/lib/debug/libfreenect.a else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../../usr/local/lib/release/freenect.lib else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../../usr/local/lib/debug/freenect.lib else:unix: PRE_TARGETDEPS += $$PWD/../../../usr/local/lib/libfreenect.a

    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../usr/local/lib/release/ -lfreenect else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../usr/local/lib/debug/ -lfreenect else:unix: LIBS += -L$$PWD/../../../usr/local/lib/ -lfreenect

    INCLUDEPATH += $$PWD/../../../usr/local/include DEPENDPATH += $$PWD/../../../usr/local/include

    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../usr/lib/release/ -lusb-1.0 else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../usr/lib/debug/ -lusb-1.0 else:unix: LIBS += -L$$PWD/../../../usr/lib/ -lusb-1.0

    INCLUDEPATH += $$PWD/../../../usr/include DEPENDPATH += $$PWD/../../../usr/include

But again the same error occurs. How do I solve it?

1

1 Answers

0
votes

I think the error message is self-explanatory. You don't have libusb-1.0.0 development package installed (i.e. libusb-1.0.0-dev).

First check you have libfreenect-dev package installed (note that this is a different package than libfreenect). If it's installed, it's likely your libusb-1.0.0-dev package is damaged and you should re-install it. If it's not installed, you should install libfreenect-dev package.

Installing libusb-1.0.0-dev:

sudo apt-get install libusb-1.0.0-dev

Installing libfreenect-dev:

sudo apt-get install libfreenect-dev

Note that libusb-1.0.0-dev and libusb-1.0.0 are two different packages, also libfreenect and libfreenect-dev.