简体   繁体   中英

Package libusb was not found in the pkg-config search path

I have installed pkg-config and libusb through brew

Now if I do

pkg-config --cflags --libs libusb

I get below message

Package libusb was not found in the pkg-config search path. Perhaps you should add the directory containing `libusb.pc' to the PKG_CONFIG_PATH environment variable No package 'libusb' found

So I followed this post and did

export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/Cellar/libusb/1.0.20/lib/pkgconfig"

But I still have the problem. What am I missing?

I am using MAC OSX El Capitan

赶紧跑:

pkg-config --cflags --libs /usr/local/Cellar/libusb/1.0.20/lib/pkgconfig/libusb-1.0.pc

I have the the same problem. This work for me (Ubuntu):

sudo apt-get install libmagickwand-dev

The problem appears to be that homebrew installs libusb with the -1.0 appended to the package and file names. So:

pkg-config --cflags --libs libusb-1.0

will find it, while:

pkg-config --cflags --libs libusb

won't. Since many ./configure and other scripts are looking for it without the -1.0 appended, they fail. To me, this looks like a bug in the homebrew package. Manually creating a non-1.0 named version worked for me, but it's not a very elegant solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM