Cross-compilation, CMake and Symlinks

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Cross-compilation, CMake and Symlinks

CMake mailing list
So I'm using this guide to cross-compile OpenCV for Raspberry Pi: I'm doing that
mainly because building anything on RPi is much slower than on Windows, and
because I need the remote debugging tools of Visual Studio. Everything
worked as expected especially with the advanced CMake subsystem of
VisualGDB. However, when I reached the deployment step I faced some

First, SmarTTY could not upload to the /usr directory because there is no
way to apply the sudo command in the application. I could copy everything to
the /home/pi directory and then I copied everything recursively to /usr,
which worked like a charm! I got remote debugging working and compiled
applications picked up all the required dependencies. I don't know if there
is an alternative to manually copying the files though.

The second annoyance was when I did used the ldconfig command:

pi@raspberrypi:~ $ sudo ldconfig

ldconfig: /usr/lib/ is not a symbolic link


pi@raspberrypi:/usr/lib $ ls libopencv_calib3d.* -al

-rwxr-xr-x 1 root root 9832912 Oct 17 18:16

-rwxr-xr-x 1 root root 9832912 Oct 17 18:17

-rwxr-xr-x 1 root root 9832912 Oct 17 18:16

As you can see, instead of creating one .so file and several symbolic links,
it creates multiple copies of the same file. This is basically because
Windows does not support symlinks. Now there are several adhoc solutions,
like scripts that convert duplicate files to symlinks but this doesn't
really look like a reliable approach. How do you solve this kind of problem
in your day to day cross-compilation tasks?

Sent from:

Powered by

Please keep messages on-topic and check the CMake FAQ at:

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support:
CMake Consulting:
CMake Training Courses:

Visit other Kitware open-source projects at

Follow this link to subscribe/unsubscribe: