I have boost C++ libraries already installed on my Fedora10 machine but I want to use a newer version that I keep at some location in my home folder. I want g++ to use include and library files from my home folder location instead of default (/usr/include and /usr/lib64).
For that matter, I also have declared CPLUS_INCLUDE_PATH and LIBRARY_PATH environment variables in my ~/.bashrc file as explained here. http://www.network-theory.co.uk/docs/gccintro/gccintro_23.html
Now when I run,
g++ -o hello.so -fPIC hello.cpp -shared -lboost_python
The preprocessor uses include files from my home folder location, overriding the default location (as it should, because CPLUS_INCLUDE_PATH has a higher precedence in the search path). But the linker does not seem to follow the same precedence rule. It always uses libboost_python.so from the default location /usr/lib64 instead of first searching LIBRARY_PATH. It only links to the libboost_python.so library in my home folder when I explicitly specify with -L switch. This is really inconvinient. Am I missing something? Please help!