Results 1 to 5 of 5
  1. #1
    Xcode help please =(

    Member Since
    Dec 10, 2007
    Posts
    1
    Xcode help please =(
    I'm having a lot of problems with Xcode. Well, thing is, I'm taking an introductory C course and I wrote the sample code that is given in the book just to see the ouput. I write the code, right? Then I click Build. It always says that the build has failed. I know the code is supposed to work because it is from the book and the output should be such. If someone could walk me through compiling a C code in Xcode, that would be awesome and I'd really really appreciate it. Thanks again!

  2. #2
    Xcode help please =(

    Member Since
    Dec 24, 2006
    Location
    N. Ireland
    Posts
    901
    Specs:
    Mac Pro 2xQuad core 2.8GHZ
    I have never used xcode - BUT if people here are to give help on your code it would be a good idea to post your code in the message so that they/we can examine it for errors.

    Also if this forum has code tags (dont know havent checked) then use them around the c source code so that it gets nicely formatted in your forum message.

  3. #3
    Xcode help please =(
    jdgti's Avatar
    Member Since
    Mar 14, 2005
    Location
    Atlanta, GA
    Posts
    443
    Specs:
    17" Macbook Pro Unibody 2.66 Ghz and Powerbook G4 1.67 GHz 2.0GB RAM
    Give me your required gcc tags and I can help you set it up.

  4. #4
    Xcode help please =(
    jdgti's Avatar
    Member Since
    Mar 14, 2005
    Location
    Atlanta, GA
    Posts
    443
    Specs:
    17" Macbook Pro Unibody 2.66 Ghz and Powerbook G4 1.67 GHz 2.0GB RAM
    Actually, no one has explained this on these forums for a while so I am going to help by posting a quick tutorial just for reference.

    To compile a plain C file:

    1. Open Xcode
    2. Go to "File" and choose "New Project"
    3. A window will pop up (Project Assistant Window), Scroll down a little and then expand the "Command Line Utility" set.
    4. Select the "Standard Tool" (This is the Xcode's Standard C representation)
    5. Name your project, Click Next
    6. Go to the left side of the window under "Groups & Files" and expand the Source set.
    7. There you will find something familiar, a "main.c" file. Click the "Editor" button at the very top of the window next to the circular "Info" button.
    8. The C code you want to edit is on your right now.

    ... Edit code ...

    To Compile:
    1. Click the "Build and Go" button at the top of the window. (Any errors should show up in red)

    To see your program in action:
    1. Go to the left again under "Groups & Files"
    2. Expand the "Products" set.
    3. Double click on the name of your project. And as Mr. Jobs says "Boom!" And there's your program.

    To Add gcc Tags:
    1. Go to the left again under "Groups & Files"
    2. Expand the "Targets" set
    3. Right click on the name of your project.
    4. Select "Get Info"
    5. Click the "Build" tab at the top.
    6. Scroll all the way down to the bottom.
    7. Under "GCC 4.0 Warnings" click "Other Warning Flags"
    8. Type in your class required flags probably something like "-ansi -pedantic -Wall" etc.

    Feel free to PM me if you want one on one help.

    Let us know how it turns out.

    Good Luck.

  5. #5
    Xcode help please =(

    Member Since
    Nov 10, 2006
    Location
    Leeds, England
    Posts
    315
    Specs:
    17" Core Duo Macbook Pro
    Excellent, that's just what I was looking for - thanks!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Xcode stopped letting me run Xcode app on iPad
    By ildsarria in forum iOS Development
    Replies: 1
    Last Post: 11-09-2011, 03:15 PM
  2. XCode 4 and C++
    By applefan90 in forum OS X - Development and Darwin
    Replies: 4
    Last Post: 03-22-2011, 01:12 AM
  3. Xcode use help
    By chat19 in forum OS X - Development and Darwin
    Replies: 8
    Last Post: 05-26-2008, 08:12 AM
  4. Xcode 1.5
    By alejandrico in forum OS X - Development and Darwin
    Replies: 0
    Last Post: 06-03-2006, 05:56 PM
  5. XCode
    By meskue in forum OS X - Development and Darwin
    Replies: 1
    Last Post: 05-21-2006, 02:42 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
  •