Hiển thị các bài đăng có nhãn header files looking up. Hiển thị tất cả bài đăng
Hiển thị các bài đăng có nhãn header files looking up. Hiển thị tất cả bài đăng

Thứ Năm, 22 tháng 5, 2014

what happened after # in C/C++

Hi all,
If you ever want to know what will happen after including a header, what does GCC look for, or where does it find these headers, or then can I read this header files in Linux. Awesom.......e!!!
If you feel awesome, you need to know a little bit about it.
Well, GCC will look in default "include" folder in Linux such as
     /usr/local/include
     libdir/gcc/target/version/include
     /usr/target/include
     /usr/include

If you mention -Idir option in the command line or makefile scripts, it will search your directory first, then the default folder. For example, if you want to search for headers in current working folder, then use "-I."
More information,
https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html.