1

I am able to build everything, but I always have to do: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/libs to have boost available.

Is there a way to include it inside the library?

My compile process is: mkdir build && cd build && cmake .. && make -j8

(-j8 for 8 core parallel build)

Thanks

3
  • What distro are you using? Several answers to this question: stackoverflow.com/questions/13428910/…
    – jtgrassie
    Jun 18 '18 at 16:50
  • This is not an answer to my question. I want to avoid exporting the library path, i want the client to run "out-of-the-box". Compiling on Ubuntu 14.x
    – pila
    Jun 18 '18 at 20:23
  • You did a dynamic build so the app needs to know where the dynamic libraries are at runtime. This is system dependent. If you don't want to configure your systems LD path to where your libraries are, and don't want to use LD_LIBRARY_PATH when launching the app, you have to do a static build.
    – jtgrassie
    Jun 19 '18 at 11:21
1

You can build a "static" binary (not actually static, but links statically against most dependencies). See the top level Makefile for the targets. The dependencies will have to be built with -fPIC (neede for ASLR), which isn't always the case for static libraries on all distros.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.