0

我在 Ubuntu 16.04 上安装了 libfreenect。然后当我在 Qt 中添加它的库时,出现以下错误。

我尝试添加 libusb-1.0。我在终端输入了这个:

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

  • .pro 文件:

    QT += 核心 QT -= gui

    配置 += c++11

    目标 = 1 配置 += 控制台配置 -= app_bundle

    模板 = 应用程序

    来源 += 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。一个

    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.一个

    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

但同样的错误再次发生。我该如何解决?

4

1 回答 1

0

我认为错误信息是不言自明的。您没有安装libusb-1.0.0开发包(即libusb-1.0.0-dev)。

首先检查您是否libfreenect-dev安装了软件包(请注意,这是一个与 不同的软件包libfreenect)。如果已安装,则很可能您的libusb-1.0.0-dev软件包已损坏,您应该重新安装它。如果没有安装,你应该安装libfreenect-dev包。

安装libusb-1.0.0-dev

sudo apt-get install libusb-1.0.0-dev

安装libfreenect-dev

sudo apt-get install libfreenect-dev

请注意,libusb-1.0.0-devlibusb-1.0.0是两个不同的包,也是libfreenectlibfreenect-dev

于 2016-10-04T17:32:54.283 回答