0

I've installed the newest Boost library from source (for c++ needs), but still have an older version installed by the package manager. I've put the newest version in a 'weird' location, not a preserved one.

Now, when I launch my test program with -I/path/to/include and -L/path/to/lib options I receive errors.

So, my question is: what should I do now to be able to work with both versions? Will adding that 'weird' location to PATH or LD_LIBRARY_PATH variable or to /etc/ld.so.conf file cause any version conflict?

1 Answers1

0

Supply LD_LIBRARY_PATH on launch.

Or on compilation:

-Wl,-rpath=/usr/weird/lib

See what libraries will be used by the executable:

ldd myprogram
Velkan
  • 3,616
  • The way I made it compile and run: clang++ -I/path/to/include main.cpp -o test -L/path/to/lib -Wl,-rpath/=path/to/lib -lboost_somelibrary and then ./test That's enough. Thanks a lot! – alxprogger Jun 27 '15 at 22:45