Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing link to libdl #1084

Closed
mike239x opened this issue Jul 23, 2019 · 4 comments
Closed

missing link to libdl #1084

mike239x opened this issue Jul 23, 2019 · 4 comments
Assignees
Labels

Comments

@mike239x
Copy link

Hi, I am trying to build Open3D v0.7.0 from source.
For whatever reason I am getting a linking error:

[ 77%] Linking CXX executable ../../bin/examples/ViewPCDMatch
/usr/bin/ld: /usr/local/lib/libglfw3.a(vulkan.c.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
examples/Cpp/CMakeFiles/ViewPCDMatch.dir/build.make:91: recipe for target 'bin/examples/ViewPCDMatch' failed
make[2]: *** [bin/examples/ViewPCDMatch] Error 1
CMakeFiles/Makefile2:1555: recipe for target 'examples/Cpp/CMakeFiles/ViewPCDMatch.dir/all' failed
make[1]: *** [examples/Cpp/CMakeFiles/ViewPCDMatch.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

Steps to reproduce:

$ git clone --recursive --branch v0.7.0 https://github.com/intel-isl/Open3D.git
$ cd Open3D/util/scripts/
$ ./build.sh

I suspect either the unusual location for the library - /usr/lib/x86_64-linux-gnu/libdl.so, or some kind of problem with cmake files (sadly I am no good with cmake so no idea what to look for).

@barnjamin
Copy link
Contributor

I had this issue last week, tried a bunch of things but ended up compiling fine after reboot.

@JeremyBYU
Copy link

Looking online informed me that the linker was missing some linked libraries on the system.
The errors I got were:

/usr/bin/ld: /usr/local/lib/libglfw3.a(vulkan.c.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
/usr/bin/ld: /usr/local/lib/libglfw3.a(x11_window.c.o): undefined reference to symbol 'XConvertSelection'

Using make -verbose showed that make was not adding these libraries, so CMake made a mistake somewhere during configuration. Some info here

So what I needed to do was add -ldl and -lX11 to the end of the link process. Instead of modifying the CMakeLists.txt file, I found a hacky way to do it on the command line. I fixed it by adding this parameter at the end of CMAKE: -DCMAKE_CXX_STANDARD_LIBRARIES="-lX11 -ldl". This is hack was found here.

Compiles fine and runs well.

@germanros1987
Copy link
Contributor

@yxlao do you have anything to say about this building issue?

@yxlao
Copy link
Collaborator

yxlao commented Aug 9, 2020

From the error message, /usr/local/lib/libglfw3.a is a system library, which is not guaranteed to be compatible with Open3D. Now we've set the default to always use the GLFW that comes with Open3D's CMake system, which should avoid this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants