1 Replies - 2129 Views - Last Post: 13 September 2012 - 03:21 AM

#1 blackfuse  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 12-September 12

Cannot get code to compile/run

Posted 12 September 2012 - 09:03 PM

// ABox.h
@interface ABox : NSObject 

@property (nonatomic, copy) NSString *name;
@property float length;
@property float width;
@property float height;

- (float) computeVolume;
- (NSString *) estimateCategory;

@end


// ABox.m
@implementation ABox
@synthesize name, length, width, height;

- (float) computeVolume {
   return self.length * self.width * self.height;
}
- (NSString *) estimateCategory {
   float vol = [self computeVolume];
   if(vol >= 8000)
      return @"Large";
   else if((vol < 8000) && (vol > 1000))
      return @"Medium";
   else
      return @"Small";
}





2 errors not sure why
Undefined symbols for architecture x86_64: "_main", referenced from: -u command line option ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Is This A Good Question/Topic? 0
  • +

Replies To: Cannot get code to compile/run

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6107
  • View blog
  • Posts: 23,661
  • Joined: 23-August 08

Re: Cannot get code to compile/run

Posted 13 September 2012 - 03:21 AM

Don't really know Objective-C, but in most C executable programs you need an entry point, which is called main. That seems to be what it's complaining about: you don't have one.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1