<< return to Pixycam.com

"cannot find -llibpixyusb"

Using the Pixy (CMUcam5), Raspberry Pi, and an LED, I am trying to write a program that flashes the LED every time a target is detected. I have written the code and everything seems fine except my command to compile. I tried this first: g++ -o pixytest pixytest.cpp -l wiringPi -l libpixyusb

Presumably, the error occurred. I have since tried various combinations of -I/home/pi/pixy/src/host, -l libpixyusb, etc., but to no avail. If you have any suggestions, they are greatly appreciated.

Note: my program actually includes “pixy.h” not “libpixyusb.h” or something similar. I was using that file however because it’s supposed to have all of the source code for controlling the Pixy through USB.

Jordan,

In your g++ line arguments, try using:

@-lpixyusb@

instead of:

@-l libpixyusb@

Good luck,
John

Jordan,

One more thing, when using libpixyUSB you will also need to link to the following libraries:

  • libboost (thread, system, chrono)
  • pthread
  • libUSB 1.0

So your full build command could look like:

@g++ -o pixytest pixytest.cpp -lwiringPi -lpixyusb -lboost_thread -lboost_system -lboost_chrono -lusb-1.0@

John