mihaibujanca / dynamicfusion

Implementation of Newcombe et al. CVPR 2015 DynamicFusion paper
BSD 3-Clause "New" or "Revised" License
391 stars 105 forks source link

undefined reference to symbol 'dlclose@@GLIBC_2.2.5' #50

Open zhaowei11594 opened 6 years ago

zhaowei11594 commented 6 years ago

Hi @mihaibujanca ; thanks for your projects, I encountered a problem, not solved for a few days。 when I run the following command:

make -j4

I get the following error:

[ 77%] Built target kfusion
[ 88%] Built target dynamicfusion
[ 94%] Linking CXX executable ../bin/dynamicfusion_kinect
/usr/bin/ld: ../../deps/terra/lib/libterra.a(DynamicLibrary.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libdl.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
apps/CMakeFiles/dynamicfusion_kinect.dir/build.make:141: recipe for target 'bin/dynamicfusion_kinect' failed
make[2]: *** [bin/dynamicfusion_kinect] Error 1
CMakeFiles/Makefile2:179: recipe for target 'apps/CMakeFiles/dynamicfusion_kinect.dir/all' failed
make[1]: *** [apps/CMakeFiles/dynamicfusion_kinect.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Any idea what this error might be?

mihaibujanca commented 6 years ago

Hmm, the error seems to come from terra. Did you use exactly the same version as in the build script (release-2016-03-25) or did you build it separately?

If you didn't use the same version, that might be the cause. The error is looking for libdl but it seems that it's not linked.

Here's my code from the build script:

cd dynamicfusion/deps
wget https://github.com/zdevito/terra/releases/download/release-2016-03-25/terra-Linux-x86_64-332a506.zip
unzip terra-Linux-x86_64-332a506.zip
rm terra-Linux-x86_64-332a506.zip
mv terra-Linux-x86_64-332a506 terra
njzhangyifei commented 5 years ago

I ran into the same problem but fixed by adding dl as part of the terra libraries.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 20faf7b..286f2cc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -43,8 +43,9 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules/")
 include(cmake/Utils.cmake)
 include(cmake/Targets.cmake)

+set(OpenCV_DIR /home/yifei/develop/opencv_version/2.4.13.6/opencv-2.4.13.6/build)
 # ---[ find dependencies
-find_package(OpenCV REQUIRED COMPONENTS core viz highgui calib3d)
+find_package(OpenCV REQUIRED COMPONENTS core highgui viz calib3d)
 find_package(CUDA REQUIRED)
 find_package(OpenNI)
 find_package(Ceres REQUIRED)
@@ -71,7 +72,7 @@ endif()
 warnings_disable(CMAKE_CXX_FLAGS /wd4985)
 set(OPT_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/deps/Opt/examples/external/mLib/include ${CMAKE_CURRENT_SOURCE_DIR}/deps/Opt/examples/shared/ ${CMAKE_CURRENT_SOURCE_DIR}/deps/Opt/API/release/include)
 set(OPT_LIBRARIES ${CMAKE_CURRENT_SOURCE_DIR}/deps/Opt/API/release/lib/libOptDev.a)
-set(TERRA_LIBRARIES ${CMAKE_CURRENT_SOURCE_DIR}/deps/terra/lib/libterra.a)
+set(TERRA_LIBRARIES ${CMAKE_CURRENT_SOURCE_DIR}/deps/terra/lib/libterra.a;dl;curses)

 add_subdirectory(kfusion)
 add_subdirectory(apps)