I have been trying to link the custom library to my cpp files using the following comamnd
g++ xx.cpp -I .../mydir/ -lfoo
where foo located in ../mydir and added this directory in LD_LIBRARY_PATH and executed ldconfig command and can find this directory listed when i execute the command
/sbin/ldconfig -v | grep -v "^"$'\t' | sed "s/:$//g"
however ld (linker script) lists the other directories which are not in ldconfig which i found by executing the following command
# ld -lfoo --verbose
I found linker search Dir commands directories using the following command
$ gcc -m64 -Xlinker --verbose 2>/dev/null | grep SEARCH | sed 's/SEARCH_DIR("=\?([^"]+)"); */\1\n/g' | grep -vE '^$'
I moved the custom lib to /usr/lib which is in search path dir's and get incompatible error during linking .
would appreciate if any leads to appending a directory to search path dir's of linker script.