Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I already compiled I already compiled libfreenect for natty and now I am trying to install kinect mouse: https://github.com/Ooblik/Kinect-Mouse/ But when I type make I receive an error...

This is the terminal:

eric@eric-desktop:~$ cd /home/eric/kinect_mouse
eric@eric-desktop:~/kinect_mouse$ mkdir build
eric@eric-desktop:~/kinect_mouse$ cd build
eric@eric-desktop:~/kinect_mouse/build$ cmake ..
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for include files CMAKE_HAVE_PTHREAD_H
-- Looking for include files CMAKE_HAVE_PTHREAD_H - found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE 
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/eric/kinect_mouse/build
eric@eric-desktop:~/kinect_mouse/build$ make
Scanning dependencies of target kmouse
[100%] Building C object CMakeFiles/kmouse.dir/kinect_mouse.c.o
Linking C executable kmouse
CMakeFiles/kmouse.dir/kinect_mouse.c.o: In function `freenect_threadfunc':
kinect_mouse.c:(.text+0xd6d): undefined reference to `freenect_set_video_format'
kinect_mouse.c:(.text+0xd81): undefined reference to `freenect_set_depth_format'
collect2: ld returned 1 exit status
make[2]: *** [kmouse] Error 1
make[1]: *** [CMakeFiles/kmouse.dir/all] Error 2
make: *** [all] Error 2
eric@eric-desktop:~/kinect_mouse/build$
share|improve this question

1 Answer 1

up vote 2 down vote accepted

That error indicates a missing library. Doing a grep -rn freenect_set_video_format . in the directory containing libfreenect revealed that fakenect/fakenect.c contained the required function. Reading the fakenect/README made clear that you need to link against that library when building kinect_mouse.

So, edit kinect_mouse/CMakeLists.txt and put link_directories(/usr/local/lib64/fakenect) in it:

cmake_minimum_required(VERSION 2.8)

link_directories(/usr/local/lib64/fakenect)

add_executable(kmouse kinect_mouse.c)

Clear your build directory and build again.

share|improve this answer
    
Thanks that worked but when I run kinect_mouse I get another error: Error: Environmental variable FAKENECT_PATH is not set. Set it to a path that was created using the 'record' utility. –  era878 Aug 17 '11 at 18:39
    
Looks like you need to run the record program too which is provided by libkinect too. Please read github.com/OpenKinect/libfreenect/blob/master/fakenect/README –  Lekensteyn Aug 18 '11 at 8:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.