Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

GothicChess.Com

macrumors regular
Original poster
Apr 6, 2007
126
0
Philadelphia, PA
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 :)

alexis_10.jpg


Thanks in advance for any help
 

szymczyk

macrumors regular
Mar 5, 2006
187
17
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.
 

HiRez

macrumors 603
Jan 6, 2004
6,265
2,630
Western US
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.
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.
 

Eraserhead

macrumors G4
Nov 3, 2005
10,434
12,250
UK
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).
 

gnasher729

Suspended
Nov 25, 2005
17,980
5,566
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?

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.
 

Thomas Harte

macrumors 6502
Nov 30, 2005
400
4
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.
 

kpua

macrumors 6502
Jul 25, 2006
294
0
Not only that, but most of Cocoa (at least Foundation) is based on Carbon and uses it under the hood.

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...
 

GothicChess.Com

macrumors regular
Original poster
Apr 6, 2007
126
0
Philadelphia, PA
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.

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!
 

GothicChess.Com

macrumors regular
Original poster
Apr 6, 2007
126
0
Philadelphia, PA
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.

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!
 

GothicChess.Com

macrumors regular
Original poster
Apr 6, 2007
126
0
Philadelphia, PA
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!
 

GothicChess.Com

macrumors regular
Original poster
Apr 6, 2007
126
0
Philadelphia, PA
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!

OPC_starting_position.jpg
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.