• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: VERY Newbie question: include paths
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: VERY Newbie question: include paths


  • Subject: Re: VERY Newbie question: include paths
  • From: Brian Smith <email@hidden>
  • Date: Tue, 2 Nov 2004 10:03:49 -0700

XCode uses gcc as the compiler and any information on how it treats include search paths and flags that can be set are in the gcc's documentation. XCode tries to give you a more human readable interface to these flags. The historically preferred method to deal with including headers on UNIX systems, where gcc was born, has been to set the base directory for header files, with the flag -I /path/to/my/project, and indicate the subdirectory path in the #include statement, example #include "mysubdir/M_.h". I doubt gcc has a flag for searching subdirectories in the search directory, but you might check gcc's documentation. It basically comes down to a developer preference of being explicate, the UNIX way, compared to implicate, the PC/Codewarrior way, on searching for headers in subdirectories.

Regards,

Brian K Smith
President
SuaveWare Inc. 	http://www.suaveware.com


On Nov 1, 2004, at 11:40 PM, Andy Wiese wrote:

My apologies for this most basic of questions. I really have tried to RTFM, I promise!

I am trying to build a new Xcode project to replace a fairly large CodeWarrior project. The CodeWarrior import facility puked, but I prefer to build a new project from scratch anyway. Only I'm not having much luck so far.

Xcode isn't finding my header files (all basic .h files). I have a large source tree which I have added to the project, but not added to the target. I have a basic main.c file which I added to the target. I have one main header file M_.h which includes all of the public .h files in the project.

From what I can tell from the minimal documentation and reading this list, I expect a header file to be found if I have added it to the project, regardless of adding it to the target. Have I misunderstood?

If I add #include "M_.h" to the prefix file, for precompiling, it is not found. If I add it to the main.c file it is not found. I added a Headers phase to the target, and added the header file to the Headers phase; it still is not found. If I move M_.h to the project directory, it is found. Or, if I add an explicit Header Search Path in the target build settings, it is found. However, during compilation of the M_.h header, none of the headers it includes are found. It is not reasonable to add a search path for each included file, so if I must rely on the explicit path method, I will have to reorganize the file structure of the project.

Is there a way for Xcode to find my header files during compilation without specifying all the search paths in the build settings?

Thanks for any hints,

Andy

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden


This email sent to email@hidden



_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: VERY Newbie question: include paths
      • From: Markian Hlynka <email@hidden>
References: 
 >VERY Newbie question: include paths (From: Andy Wiese <email@hidden>)

  • Prev by Date: Re: VERY Newbie question: include paths
  • Next by Date: Re: Return key doesn't in Xcode editor
  • Previous by thread: Re: VERY Newbie question: include paths
  • Next by thread: Re: VERY Newbie question: include paths
  • Index(es):
    • Date
    • Thread