2 easy questions (I hope)

Discussion in 'Mac Programming' started by GothicChess.Com, Apr 6, 2007.

  1. macrumors regular

    GothicChess.Com

    Joined:
    Apr 6, 2007
    Location:
    Philadelphia, PA
    #1
    Greetings to everyone,

    I've been a Mac programmer since 1984, but had been "out of the game" for a few years, and only started working in XCode a little while ago.

    I have 2 short questions.

    1. Is the Carbon API going to be supported by XCode for a while, or will we all have to switch to Cocoa and ObjectiveC eventually?

    2. I have XCode 1.1 on OS X 10.3.9 running on an old G4 Cube. It seems that the long long data type is not supported (I can't "count" over that 4.2 billion limit of 2^32). Do I need a G5 AND the latest version of XCode to take advantage of this, and, if so, can I still use the Carbon API if I purchase what I need?

    The reason I ask is that I want to convert a very cool chess program I wrote for the PC to Mac OS X. This is a new version of chess with two new pieces, an Archbishop that can move like a Bishop or Knight, and a Chancellor that can move like a Rook + Knight.

    The program is here: http://www.gothicchess.com/gv_release.html

    And the 6'5" tall blonde on the website is not too bad to look at either :)

    [​IMG]

    Thanks in advance for any help
     
  2. macrumors regular

    Joined:
    Mar 5, 2006
    #2
    Carbon works on the latest versions of Xcode and Mac OS X. It is not going away any time soon because large companies like Adobe and Microsoft use Carbon to write their Mac apps.

    Instead of using the long long data type, try using the Uint64 and Sint64 data types. The Core Services framework has a header file Math64.h that provides support for 64-bit integers. You can use the functions in Math64.h in Carbon, and they work on all versions of Mac OS X so you can still use your Cube.
     
  3. macrumors 601

    HiRez

    Joined:
    Jan 6, 2004
    Location:
    Western US
    #3
    Not only that, but most of Cocoa (at least Foundation) is based on Carbon and uses it under the hood. So yeah, it'll be around for awhile. That said, if I were starting a new project right now, I'd write it in Cocoa. While Carbon will still be there, more and more new stuff will be biased towards Cocoa and Objective-C, as will the majority of documentation and code samples as time goes on.
     
  4. macrumors G4

    Eraserhead

    Joined:
    Nov 3, 2005
    Location:
    UK
    #4
    Carbon is really for cross platform development, if you are going to make your chess program available for the Mac and PC with new releases then it's the best choice for a Mac only program Cocoa is probably better, though as you are porting an application, Carbon might be easier (especially if it is C++ on the PC).
     
  5. macrumors G5

    gnasher729

    Joined:
    Nov 25, 2005
    #5
    Carbon is here to stay. What is going to disappear is antique stuff, like Quickdraw (Quartz will give you better results and run much faster anyway), but Carbon will stay and is a fine API.

    Eventually you may have to learn a bit of Cocoa and Objective C; some APIs are only available in Cocoa, but they are quite easy to call from C.

    XCode 1.1 is absolutely outdated. The current version is 2.4.1 and I would really recommend that you download it. Get yourself a free ADC membership and prepare for a 900 MB download :) Seriously, you shouldn't be using XCode 1.1 anymore.
     
  6. macrumors 6502

    Joined:
    Nov 30, 2005
    #6
    To add to the comments of the poster above, I believe Xcode 1.5 is the most recent version available for OS X v10.3, and you should probably upgrade to that. Also maybe look into options for getting someone with Xcode 10.4 to build for you at some point — otherwise you're not going to get a Universal Binary.
     
  7. macrumors 6502

    Joined:
    Jul 25, 2006
    #7
    While this is true in several notable cases (for example, the entire event loop structure), I wouldn't go so far to say that most of Foundation is based on Carbon. More correctly, a great deal of both Carbon and Cocoa under OS X share CoreFoundation as their main code base -- that doesn't imply dependence of Cocoa on Carbon.

    But regardless, the point is the same. Eliminating Carbon at this point would be very difficult and even detrimental given the major companies who depend on it and the notable cases where Cocoa does depend on Carbon. Carbon is here to stay, I think, until at least OSXI or OSXII or whatever they're going to call it...
     
  8. macrumors 604

    thejadedmonkey

    Joined:
    May 28, 2005
    Location:
    Pa
    #8
    She doesn't look 6'5"
     
  9. thread starter macrumors regular

    GothicChess.Com

    Joined:
    Apr 6, 2007
    Location:
    Philadelphia, PA
    #9
    Yes, she really is 6'5"

    Here is a picture from us in Iceland...

    The long legs of Alexis
     
  10. thread starter macrumors regular

    GothicChess.Com

    Joined:
    Apr 6, 2007
    Location:
    Philadelphia, PA
    #10
    It would be great if XCode contained the same "metaphor" as the Software Update services that are offered, and a menu item allowed it to be downloaded in real time.

    I have hunted around for XCode updates, and there was no way that was immediately obvious to me to obtain it.

    Someone mentioned getting an ADC membership, I will explore how to do this in the interim.

    A heartfelt thanks to everyone who has chimed in to offer advice. It is much appreciated!
     
  11. macrumors 6502a

    johnee

    #11
    6'5", 6'6", whatever it takes...
     
  12. thread starter macrumors regular

    GothicChess.Com

    Joined:
    Apr 6, 2007
    Location:
    Philadelphia, PA
    #12
    Thanks for the reassurances! I was hoping that Carbon would remain, but I have been "left in the dust" before by "radical" API changes (I was around for the OS 6 to 7 change, which seemed enormous at the time, then OS 9 to OS X made me a "programming dinosaur") so I thought that maybe the hardware switch would trigger even more changes.

    The 64-bit integer usage is a major deal, I would not be able to solve larger endgame databases without this. I see now that I had to also switch my options under the "Target" pane to not use the default C compiler settings, which did not include the C90 standard! Now at least I am "somewhat modern" with C99, which does allow the long long.

    Again, many thanks!
     
  13. macrumors G4

    Eraserhead

    Joined:
    Nov 3, 2005
    Location:
    UK
    #13
    You have to be an ADC member to get Xcode updates, but the free membership is fine for this purpose.
     
  14. thread starter macrumors regular

    GothicChess.Com

    Joined:
    Apr 6, 2007
    Location:
    Philadelphia, PA
    #14
    Finally moved up to XCode 1.5

    Thanks for the tips regarding XCode. I joined ADC and now have the "bleeding edge" version of XCode for 10.3.9 which is version 1.5.

    The download is a painless 600 MB with cable modem, ya gotta love it!
     
  15. macrumors G5

    gnasher729

    Joined:
    Nov 25, 2005
    #15
    In case you are looking for ADC: www.apple.com, click on "Developer" :p
     
  16. thread starter macrumors regular

    GothicChess.Com

    Joined:
    Apr 6, 2007
    Location:
    Philadelphia, PA
    #16
    Thanks again!

    Thanks again to everyone, I am finally using 64-bit long long data types in my program using X Code 1.5 properly, and I have 8,000 lines of code down and cranking more every day!

    [​IMG]
     

Share This Page