2

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

Tomer
  • 189
  • 9

2 Answers2

2

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.

kallikak
  • 784
  • 5
  • 13
1

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.

Community
  • 1
  • 1
Basile Starynkevitch
  • 1
  • 16
  • 251
  • 479