fireant / angkor

Angkor currently converts the Kinect's depth map to point cloud and uses OpenSceneGraph to visualize it, the point cloud can be saved as a .ply file.
10 stars 1 forks source link

undefined reference to symbol 'pthread_create@@GLIBC_2.1' #1

Open dingxiaoliang33 opened 8 years ago

dingxiaoliang33 commented 8 years ago

Hello! I'm very exciting to use this project but I cannot run. Could you help me. I followed the installation steps,install three requirements. libfreenect: [https://github.com/OpenKinect/libfreenect] AntTweakBar: [http://anttweakbar.sourceforge.net/doc/] OpenSceneGraph: [https://github.com/openscenegraph/OpenSceneGraph]

when I make the project, encounter a problem.

 make
Linking CXX executable angkor
/usr/bin/ld: CMakeFiles/angkor.dir/main.cpp.o: undefined reference to symbol 'pthread_create@@GLIBC_2.1'
//lib/i386-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [angkor] Error 1
make[1]: *** [CMakeFiles/angkor.dir/all] Error 2
make: *** [all] Error 2

Is this a problem about dynamic link library error? Or should I modify the CMakeList? What can I do to solve this problem? I really need this module to work and I will appreciate if you can help me. Thank !!

fireant commented 8 years ago

Change the last line of CMakeLists.txt to target_link_libraries(angkor freenect OpenThreads osg osgSim osgViewer AntTweakBar -lpthread) build again and see if that resolves the issue. We are adding -lpthread to the list of libraries.

dingxiaoliang33 commented 8 years ago

Thanks for your reply! I add the -lpthread to the CMakeList, The previous error no longer appear ,Then another one arise.

make
[ 50%] Building CXX object CMakeFiles/angkor.dir/main.cpp.o
[100%] Building CXX object CMakeFiles/angkor.dir/tweakbargui.cpp.o
Linking CXX executable angkor
/usr/bin/ld: CMakeFiles/angkor.dir/tweakbargui.cpp.o: undefined reference to symbol '_ZN5osgGA15GUIEventHandler6handleEPNS_5EventEPN3osg6ObjectEPNS3_11NodeVisitorE'
//usr/local/lib/libosgGA.so.145: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [angkor] Error 1
make[1]: *** [CMakeFiles/angkor.dir/all] Error 2
make: *** [all] Error 2

My environment list as follow: Ubuntu: 14.04 Binutils : GNU ld (GNU Binutils for Ubuntu) 2.24 cmake: cmake version 2.8.12.2 gcc: gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4

fireant commented 8 years ago

add osgGA to the list of libraries as well

dingxiaoliang33 commented 8 years ago

It compiles! But It still cannot run. ··· root@ubuntu:/home/dingliang/angkor-master/angkor-master/build# ./angkor Failed to open motor subddevice or it is not disabled.Failed to open audio subdevice or it is not disabled.Could not open device root@ubuntu:/home/dingliang/angkor-master/angkor-master/build# lsusb Bus 001 Device 003: ID 045e:02ae Microsoft Corp. Xbox NUI Camera Bus 001 Device 002: ID 045e:02ad Microsoft Corp. Xbox NUI Audio Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 004: ID 045e:02b0 Microsoft Corp. Xbox NUI Motor Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub ··· My kinect is Kinect V1.

fireant commented 8 years ago

Sorry, I cannot help you with that. See why libfreenect has that issue with your device. Maybe this helps.

dingxiaoliang33 commented 7 years ago

Thanks for your patience! The project can run smoothly.