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

dlib link failure #21

Closed
takotakot opened this issue Jan 18, 2018 · 2 comments
Closed

dlib link failure #21

takotakot opened this issue Jan 18, 2018 · 2 comments

Comments

@takotakot
Copy link

takotakot commented Jan 18, 2018

Hi,

I encountered a compilation (link) problem with x86_64 environment:

cmake --version
cmake version 3.5.1

cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"

gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609

I built dlib with:

cmake -DCMAKE_INSTALL_PREFIX:PATH=/home/takotakot/dlib_install/ -DBUILD_SHARED_LIBS=ON ..
make
make install

gazr with:

dlib_DIR=/home/takotakot/dlib_install/ cmake .. -DWITH_ROS=false
make

And get

/usr/bin/ld: /home/tako/dlib_install/lib/libdlib.a(base64_kernel_1.cpp.o): relocation R_X86_64_32S against `_ZTVN4dlib6base64E' can not be used when making a shared object; recompile with -fPIC

The content of CMakeFiles/gazr.dir/link.txt is

/usr/bin/c++  -fPIC   -shared -Wl,-soname,libgazr.so -o libgazr.so CMakeFiles/gazr.dir/src/head_pose_estimation.cpp.o /home/takotakot/dlib_install/lib/libdlib.a /usr/local/lib/libopencv_calib3d.so.2.4.13 -lpthread -lnsl -lpng -lz -ljpeg /usr/local/lib/libopencv_features2d.so.2.4.13 /usr/local/lib/libopencv_flann.so.2.4.13 /usr/local/lib/libopencv_highgui.so.2.4.13 /usr/local/lib/libopencv_imgproc.so.2.4.13 /usr/local/lib/libopencv_core.so.2.4.13 -ldl -lm -lpthread -lrt -Wl,-rpath,/usr/local/lib

When I changed /home/takotakot/dlib_install/lib/libdlib.a to /home/takotakot/dlib_install/lib/libdlib.so manually, I could comiple libgazr.so .

Is this a gazr or cmake (or other tools) problem? If it could be fixed with changing some cmake configuration of gazr, I want to fix. But I'm sorry that I don't familiar with cmake.

Thanks

@severin-lemaignan
Copy link
Owner

It's a dlib issue, I believe. But if you are running ubuntu 16.04, you can simply apt install libdlib-dev and you're done!

@takotakot
Copy link
Author

Thank you!

I wanted to build them myself, but I'll try libdlib-dev later. I'll report this issue to dlib.

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

No branches or pull requests

2 participants