Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Defining a Class Trouble

Defining a Class Trouble
Thread Tools
Senior User
Join Date: Jun 2002
Location: Albuquerque, NM
Status: Offline
Reply With Quote
Oct 24, 2004, 03:27 PM
 
Hi guys,

I picked up the book Programming in Objective-C by Stephen Kochan. For the lesson in Chapter 2 he says to define a class called Points. When I define the class in the following code I get the error error: 'Point' redeclared as a different kind of symbol'. When I change Point to a lowercase point xCode will then compile the program. Is uppercase Point reserved in the imported Object.h? Here's a snip of the beginning of the code:

#import <stdio.h>
#import <objc/Object.h>
//------------@interface section---------------

@interface Point: Object
{
int xCord;
int yCord;
}
-(void) print;
-(void) setX: (int) x;
-(void) setY: (int) y;

@end


I just want to clarify my assumption.

Thanks,

Brad
     
Mac Elite
Join Date: Sep 2000
Location: Tempe, AZ
Status: Offline
Reply With Quote
Oct 24, 2004, 04:07 PM
 
'Point' is defined in Carbon, so if you're using the standard Xcode project, Point is getting defined in the precompiled headers, and so you've got a name conflict.
Geekspiff - generating spiffdiddlee software since before you began paying attention.
     
nerd  (op)
Senior User
Join Date: Jun 2002
Location: Albuquerque, NM
Status: Offline
Reply With Quote
Oct 24, 2004, 05:56 PM
 
Originally posted by smeger:
'Point' is defined in Carbon, so if you're using the standard Xcode project, Point is getting defined in the precompiled headers, and so you've got a name conflict.
Cool, thanks!

Brad
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:17 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2