some problem with Xcode

Discussion in 'Mac Programming' started by quanganhct, Jun 11, 2011.

  1. macrumors member

    Joined:
    Dec 29, 2010
    #1
    Hello,

    I have a problem when compiling a project in Xcode. Well that's an exercise about OOP, and my mission is to implement the functions missed in that project.

    When I compile by Xcode, there was alot errors appeared, but when I use Makefile, then it's a piece of cake.

    I wonder why, using Xcode cannot do but using Makefile can.

    Someone please help me.

    PS: I upload my project, with the Makefile included.
     

    Attached Files:

  2. jiminaus, Jun 11, 2011
    Last edited: Jun 11, 2011

    macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #2
    Because Pile.cxx, where all the compiler errors are, isn't involved in the Makefile.

    EDIT:
    Oh, now I've looked closer at the code, I see main.cc includes Pile.h which includes Pile.cxx. So the problem is actually that XCode is trying to compile Pile.cxx by itself. You need to exclude Pile.cxx from the build.

    To do this in XCode 4:
    1. Select the project at the top of the tree on the left-hand side of the XCode window.
    2. Select the ProjectMAC target.
    3. Select the Build Phases tab.
    4. Expand the Compile Sources build phase.
    5. Select Pile.cxx
    6. Click the remove (-) button
     
  3. thread starter macrumors member

    Joined:
    Dec 29, 2010
    #3
    But I use Xcode 3, is there anyway to handle it ?
     
  4. macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #4
    You didn't specify which XCode you were using, so I just assumed you were using the same as me.

    I don't have XCode 3 so I can't confirm this, but Fritz Anderson's XCode 3 Unleashed book says to:

    1. Expand Targets
    2. Expand the ProjectMAC target
    3. Expand Compile Sources
    4. Remove Pile.cxx
     
  5. thread starter macrumors member

    Joined:
    Dec 29, 2010
    #5
    hooray !

    It worked well . Thanks a lot :)
     

Share This Page