Results 1 to 3 of 3
  1. #1

    Member Since
    Nov 13, 2008
    Adding Header File for C++ Program in Xcode
    Hi all,

    I've been using Microsoft Visual Studio for my basic C++ class at Ucla. I know how to create a project and everything, but am confused about which folder to add a header file.

    In visual studio, there is a "Header Files" folder right above the "Source Files" folder in which you can add your header files.

    In Xcode, there is no such folder. Where do I add my header file?

    Under the "Documentation" or "Products" folder perhaps?

    Thanks for your help,


  2. #2

    Member Since
    Nov 13, 2008
    i think i got it, is this the correct location? the header file i was tying to add is cards.h .

    Free File Hosting Made Simple - MediaFire

    it doesnt look like the picture wants to show up, but its Picture 1.jpeg once you click on the link.

  3. #3

    Member Since
    Mar 15, 2007
    17" MacBook Pro, 2.33GHz C2D, 2GB RAM
    Sorry, I won't visit the link you provided (particularly since MediaFire shows many reports of popups and browser exploits on SiteAdvisor).

    In all of the smaller Xcode projects I've encountered, header files are usually dumped into both the same physical folder and the same "project group" as their corresponding implementation files (i.e., either "Classes" or "Other Sources", whichever is appropriate). However, there's nothing constraining you from categorizing things in the project differently if you wish. At a minimum, you could easily add a "Header Files" project group to "virtually" separate the header files if that would make things feel more familiar to you.

    (Ignore the next two paragraphs if they are too confusing.)

    You could go a step further and also create a separate physical location for those files. In this case, just remember that the compiler for each source file needs to be able to find the referenced header files, so if you have them physically separated, you must either specify a relative path to those header files in your #include (or #import) directives, or else add each of the header file folders to the "user header search path" in the project's build settings.

    By the way, you could also organize your header files differently in Visual Studio if you wanted to ... the default project organization that VS gives you is not cast in stone either.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Adding Video to Xcode 4.2
    By ray0004 in forum iOS Development
    Replies: 0
    Last Post: 11-20-2011, 11:23 PM
  2. Adding Video to Xcode 4.2
    By ray0004 in forum macOS - Apps and Games
    Replies: 0
    Last Post: 11-20-2011, 05:13 PM
  3. Adding wxWidgets to Xcode
    By Haxorus111 in forum iOS Development
    Replies: 0
    Last Post: 09-22-2011, 12:34 AM
  4. Xcode Header Comments
    By aqnato in forum macOS - Apps and Games
    Replies: 0
    Last Post: 08-21-2009, 06:31 PM
  5. xCode:Modding default header //'s ??
    By ND45 in forum macOS - Development and Darwin
    Replies: 0
    Last Post: 03-25-2009, 12:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts