Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to remove path from the default gcc search path

Tags:

c

gcc

ubuntu

boost

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

like image 313
Tomer Avatar asked Oct 28 '25 13:10

Tomer


2 Answers

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.

like image 56
kallikak Avatar answered Oct 30 '25 04:10

kallikak


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.

like image 42
Basile Starynkevitch Avatar answered Oct 30 '25 02:10

Basile Starynkevitch



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!