How to make g++ search for header files in a specific directory?

前端 未结 4 1642
走了就别回头了
走了就别回头了 2020-11-30 20:46

I have a project (a library) that is subdivided into a few directories with code in them. I\'d like to to have g++ search for header files in the project\'s root directory,

4条回答
  •  無奈伤痛
    2020-11-30 21:14

    Headers included with #include <> will be searched in all default directories , but you can also add your own location in the search path with -I command line arg.

    I saw your edit you could install your headers in default locations usually

     /usr/local/include
     libdir/gcc/target/version/include
     /usr/target/include
     /usr/include
    

    Confirm with compiler docs though.

提交回复
热议问题