Ajuda com erro de compilação

1

Eu já compilei já compilei o libfreenect para o natty e agora estou tentando instalar o kinect mouse: link Mas quando digito make , recebo um erro ...

Este é o 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$
    
por era878 17.08.2011 / 10:10

1 resposta

2

Esse erro indica uma biblioteca ausente. Fazer um grep -rn freenect_set_video_format . no diretório que contém libfreenect revelou que fakenect/fakenect.c continha a função necessária. A leitura do fakenect / README deixou claro que você precisa vincular-se a essa biblioteca ao criar kinect_mouse .

Então, edite o kinect_mouse/CMakeLists.txt e coloque link_directories(/usr/local/lib64/fakenect) nele:

cmake_minimum_required(VERSION 2.8)

link_directories(/usr/local/lib64/fakenect)

add_executable(kmouse kinect_mouse.c)

Limpe seu diretório de criação e crie novamente.

    
por Lekensteyn 17.08.2011 / 11:01