Results 1 to 2 of 2

Thread: Find the default library paths and default headers include paths

  1. #1
    Join Date
    Jan 2024

    Find the default library paths and default headers include paths

    I'm on an Ubuntu 22.04 system and I'm working with C language and libraries.

    I know ( from different books, included "The Linux Programming Interface" by Kerrisk ) that this algorithm is used when looking for runtime shared libraries locations ( I just omitted the preloaded libraries for the sake of simplicity ) :

    When RUNPATH field is specified (i.e. DT_RUNPATH is non-empty)

    2 ) runpath (DT_RUNPATH field)
    3 )
    4 ) default library paths (/lib and /usr/lib)

    In the absence of RUNPATH (i.e. DT_RUNPATH is empty string)

    1 ) RPATH
    3 )
    4 ) default library paths (/lib and /usr/lib)

    The problem is that most books say that generally speaking the default library paths are /lib and /usr/lib but they don't mention HOW I CAN GET THE EXACT DEFAULT LIBRARY PATHS FOR MY SYSTEM. What command can I use on my Ubuntu 22.04 system ?

    What about the default headers include paths ? What command can I use the get them ?

    And finally what is the specific algorithm used in my ubuntu system when dealing with "headers.h" vs <headers.h> ?

  2. #2
    Join Date
    Jun 2006
    Ubuntu 22.04 Jammy Jellyfish

    Re: Find the default library paths and default headers include paths

    Another duplicate. @luca-ub-1993, please do not post duplicates in different parts of the forum - you posted three identical posts altogether. This is not good netiquette, it dilutes community effort and causes confusion.

    Thread closed. The still open thread is here:
    Ubuntu 20.04 Desktop Guide - Ubuntu 22.04 Desktop Guide - Forum Guide to BBCode - Using BBCode code tags

    Member: Not Canonical Team

    If you need help with your forum account, such as SSO login issues, username changes, etc, the correct place to contact an admin is here. Please do not PM me about these matters unless you have been asked to - unsolicited PMs concerning forum accounts will be ignored.

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts