Compiling against libusb-dev on Ubuntu

后端 未结 2 1884
一向
一向 2021-02-15 14:10

I am trying to compile the example libusb.c provided by libusb package (if you dl the source code.)

It doesn\'t work to say the least.

#include 

        
2条回答
  •  旧时难觅i
    2021-02-15 14:50

    This is what I had to do on Debian. It should be at least similar in Ubuntu.

    Install libusb-1.0-0-dev

    Instead of:

    #include 
    

    do:

    #include 
    

    Compile with:

    gcc example.c `pkg-config --libs --cflags libusb-1.0`
    

提交回复
热议问题