Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Undefined reference to libusb_get_parent() - compiling freenect

I'd want to install some libraries in order to connect a Kinect 360 in a Raspberry following this link: http://www.kdab.com/setting-up-kinect-for-programming-in-linux-part-1/

First, I checked this on Ubuntu and all was fine. However, when I want to build libfreenect (with make) this error is shown:

../lib/libfreenect.so.0.5.2: undefined reference to 'lisusb_get_parent'
collect2: ld returned 1 exit status

I'm new on Raspberry and I don't know how to fix this.

Any help is appreciated!! :)

Thanks!

like image 904
Thabby07 Avatar asked Dec 15 '22 16:12

Thabby07


1 Answers

I ran into the same problem, starting from a fresh install of Raspbian 2015-02-16. Apparently (based on this), the version of libusb you get with apt-get is old. My workaround, based on recommendations from that link and elsewhere, is to build libusb from the more recent sources and convince libfreenect to use that:

Grab the packages you'll need to compile libusb and libfreenect:

sudo apt-get install git cmake build-essential
sudo apt-get install freeglut3-dev libxmu-dev libxi-dev
sudo apt-get install libudev-dev

Remove the existing libusb, if it's there:

sudo apt-get remove libusb-1.0-0-dev

Grab the sources for libusb-1.0.18:

wget http://sourceforge.net/projects/libusb/files/libusb-1.0/libusb-1.0.18/libusb-1.0.18.tar.bz2
tar -xvf libusb-1.0.18.tar.bz2

Build and install the updated libusb:

cd libusb-1.0.18/
./configure --prefix=/usr --disable-static
make
sudo make install

Ugly hack to convince libfreenect to use the new libusb library:

sudo ln -s /usr/lib/libusb-1.0.so /usr/lib/arm-linux-gnueabihf/libusb-1.0.so

Then you should be able to build libfreenect.

like image 77
KDeus Avatar answered May 19 '23 19:05

KDeus