How to make libusb library visible to another program?

拥有回忆 提交于 2019-12-07 21:00:28

问题


I am trying to compile hidapi library. In order to compile that, I need libusb-1.0. I've downloaded that, configured, made and installed to /usr/local/lib. But when I try to compile hidapi, it doesn't see libusb-1.0:

cc -Wall -g -c -I../hidapi pkg-config libusb-1.0 --cflags hid-libusb.c -o hid-libusb.o -L/usr/local/lib Package libusb-1.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `libusb-1.0.pc' to the PKG_CONFIG_PATH environment variable No package 'libusb-1.0' found /bin/sh: cc: not found make: * [hid-libusb.o] Error 127

How can I fix that?

(compilation happens on Synology NAS)


回答1:


Since you installed to /usr/local/lib, pkg-config will not find your installation unless you set PKG_CONFIG_PATH appropriately

Try running:

export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig"

in your shell and then re-attempting to build your code



来源:https://stackoverflow.com/questions/10157898/how-to-make-libusb-library-visible-to-another-program

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!