When compiling with boost library in Ubuntu, how can I make sure the GCC use my boost path?
The current Boost version in Ubuntu is 1.46.
I compile version 1.52.
I know I can use "-L/path/to/new/lib" to add library to the search path,but how can I make sure GCC wont link to the old library?
Regards, Tomer
The -L option adds library search paths to the beginning of the search path, so if you have your own version it will be found before the default system version.
Just pass the -v option to gcc or g++ to understand what linking command it is running. You could even add -Wl,--verbose to have the ld command be also verbose.
You might also be interested in -rpath, see this answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With