Xcode Build Search Paths settings, xcode search paths

Source: Internet
Author: User

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.