Where are include files stored - Ubuntu Linux, GCC

后端 未结 4 1437
面向向阳花
面向向阳花 2020-12-02 08:35

So, when we do the following:

#include 

versus

#include \"myFile.h\"

the compiler, GCC in

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-02 09:10

    Karl answered your search-path question, but as far as the "source of the files" goes, one thing to be aware of is that if you install the libfoo package and want to do some development with it (i.e., use its headers), you will also need to install libfoo-dev. The standard library header files are already in /usr/include, as you saw.

    Note that some libraries with a lot of headers will install them to a subdirectory, e.g., /usr/include/openssl. To include one of those, just provide the path without the /usr/include part, for example:

    #include 
    

提交回复
热议问题