Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am new to linux and I want to add lib64/ to linker commnad line. Can anyone suggest how can i do this? Thanks in advance

share|improve this question
  1. If you are compiling something and you want the compiler to search a specific directory, you can add the -L flag. Like this:

    g++ -L /lib64
  2. You can also add this directory to the environment variable 'LD_LIBRARY_PATH'. Like this:

    export LD_LIBRARY_PATH="/lib64"
  3. You can also use ldconfig to add a directory to the search path. Like this:

    sudo ldconfig /lib64
  4. Finally, you can add the directory to /etc/ (and rerun 'sudo ldconfig') to make this change permanent.

    sudo echo "/lib64" >> /etc/; sudo ldconfig
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.