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 796483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:38:48+00:00 2026-05-14T22:38:48+00:00

In MSVC++ #include files are searched for differently depending on whether the file is

  • 0

In MSVC++ #include files are searched for differently depending on whether the file is enclosed in “” or <>. The quoted form searches first in the local folder, then in /I specified locations, The angle bracket form avoids the local folder.

This means, in MSVC++, its possible to have header files with the same name as runtime and SDK headers.

So, for example, I need to wrap up the windows sdk windows.h file to undefine some macro’s that cause trouble. With MSVS I can just add a (optional) windows.h file to my project as long as I include it using the quoted form :-

// some .cpp file
#include "windows.h" // will include my local windows.h file

And in my windows.h, I can pull in the real one using the angle bracket form:

// my windows.h
#include <windows.h> // will load the real one
#undef ConflictingSymbol

Trying this trick with GCC in XCode didn’t work. angle bracket #includes in system header files in fact are finding my header files with similar names in my local folder structure.
The MSVC system means its quite safe to have a “String.h” header file in my own folder structre. On XCode this seems to be a major no no.

Is there some way to control this search path behaviour in XCode to be more like MSVC’s? Or do I just have to avoid naming any of my headers anything that might possibly conflict with a system header. Writing cross platform code and using lots of frameworks means the possibility of incidental conflicts seems large.

  • 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-14T22:38:49+00:00Added an answer on May 14, 2026 at 10:38 pm

    You should be able to do the same with gcc (I don’t know how much xcode wraps things and prevent access to some features). There is a bunch of options controlling the search path (see http://gcc.gnu.org/onlinedocs/gcc-4.5.0/cpp/Search-Path.html and http://gcc.gnu.org/onlinedocs/gcc-4.5.0/cpp/Invocation.html and look for -iquote). Calling gcc with -v will give you the path specifying where the two differs.

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

Sidebar

Related Questions

How can I specify where MSVC searches for include files? I want to add
I want to use MSVC compiler to build a DLL file. The problem is
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\list(1194): error C2451: conditional expression of type 'void' is
In GCC you can use the '-include ' flag to automatically include a file
For example in Boost. I set an include directory in MSVC++2010 to the Boost
Python rather stupidly has a pragma directive in its include files that forces a
I have a file structure like this: file1.h extern const char *build_info[][3]; file1.cpp #include
In MSVC, DebugBreak() or __debugbreak cause a debugger to break. On x86 it is
With msvc, is there an equivalent to gcc's __builtin_return_address? I'm looking to find the
i did this in msvc 2005. typedef void (*cleanup_t)(); void func(cleanup_t clean) { cleanup_t();

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.