Xcode Build Search Paths settings, xcode search paths
Xcode Build Search Paths settings
C/c ++ header file reference
Include <> reference the header file in the compiler's class library path
Include "" refers to the header file of the relative path of the project directory
Include is a Compilation instruction. during compilation, the compiler will replace the relative path with the absolute path. Therefore, the absolute path of the header file = search path + relative path.
Search Paths setting Search path under Xcode Build Settings
Header Search Paths: Header file Search path settings
$ (SRCROOT) macro and $ (PROJECT_DIR) macro both indicate the parent directory of xxx. xcodeproj.
For example, reference the header file testDemo/scr/test. h of the project,
Add $ (SRCROOT) to Header Search Paths and reference it as include "scr/test. h"
If $ (SRCROOT)/scr is added to the Header Search Paths, the Header file references include "test. h" directly"
If Always Search User Paths is set to yes, the compiler first searches for the directory in the User Header Search Paths path. In this case, include <string. h>, the files in the User Header Search Paths Search directory will overwrite the system's Header files.
When using mac's xcode to compile c ++ programs, the conioh header file shows an error: "'conioh' file not found". How can this header file not a standard C library file be solved, so you have to get it in.
How does xcode automatically add header files? Open the project properties and set the Header Search Paths!