Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 982813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:45:30+00:00 2026-05-16T04:45:30+00:00

(Posting this question for reference purpose, I’ll answer immediately) How to add header search

  • 0

(Posting this question for reference purpose, I’ll answer immediately)

How to add header search paths to Xcode?
Especially when including with this syntax:

include <myheader.h>
  1. Adding path globally to all projects like system headers.
  2. Adding path to only to a specific project.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T04:45:31+00:00Added an answer on May 16, 2026 at 4:45 am

    We have two options.

    1. Look at Preferences->Locations->"Custom Paths" in Xcode’s preference. A path added here will be a variable which you can add to "Header Search Paths" in project build settings as "$cppheaders", if you saved the custom path with that name.

      • https://help.apple.com/xcode/mac/11.4/#/deva52afe8a4
    2. Set HEADER_SEARCH_PATHS parameter in build settings on project info. I added "${SRCROOT}" here without recursion. This setting works well for most projects.

    About 2nd option:

    Xcode uses Clang which has GCC compatible command set.
    GCC has an option -Idir which adds system header searching paths. And this option is accessible via HEADER_SEARCH_PATHS in Xcode project build setting.

    However, path string added to this setting should not contain any whitespace characters because the option will be passed to shell command as is.

    But, some OS X users (like me) may put their projects on path including whitespace which should be escaped. You can escape it like /Users/my/work/a\ project\ with\ space if you input it manually. You also can escape them with quotes to use environment variable like "${SRCROOT}".

    Or just use . to indicate current directory. I saw this trick on Webkit’s source code, but I am not sure that current directory will be set to project directory when building it.

    The ${SRCROOT} is predefined value by Xcode. This means source directory. You can find more values in Reference document.

    PS. Actually you don’t have to use braces {}. I get same result with $SRCROOT. If you know the difference, please let me know.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to integrated linkedIn using this question answer Posting LinkedIn message from
I'm really posting this question so that others searching for the answer can find
NOTE : Right before posting this question it occurred to me there's a better
I searched StackOverflow before posting this question but I wasn't able to find the
It might be a long shot posting this question here but we will see.
Before you all get pissy about me posting this question again, let me explain
Edit: I've learned much since the posting of this question, and so I have
This question is already answered. I discovered what the problem is. But, I'm posting
I am again posting the same question. Please help me in this problem. Here
this is my first time posting here, I have a question which I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.