• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Obj-C with C problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Obj-C with C problems


  • Subject: Re: Obj-C with C problems
  • From: "R. Tony Goold" <email@hidden>
  • Date: Thu, 24 May 2001 00:06:39 -0400

I had no problems getting it to compile with the makenoise() function in a separate .c file. Unfortunately your colour formatting wasn't received, so I'm not sure which lines you mean, but I assume you meant the makenoise declaration and definition :-)

Can you give us an idea of what compiler errors you're getting? Is the "void makenoise(void);" in a .h file and the "void makenoise(void) { SysBeep(2); }" in a separate .c file?

Tony


On Wednesday, May 23, 2001, at 11:32 , Daniel Gregg wrote:

This may well be a bone-head question but I keep fighting with massive
errors. Look at the code below and tell me why it will not compile if
the red lines are in a separate .c file: I'm using PB with a standard
"new Cocoa" project default settings. I simply wanted to create some C
routines in a separate file but evidently I can't?

#import "MyObject.h"
#import <Carbon/Carbon.h>
void makenoise(void);

@implementation MyObject

- (IBAction)startCapture:(id)sender
{
makenoise();
}

- (void)awakeFromNib
{
makenoise();
}
@end

void makenoise (void)
{
SysBeep(2);
}
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev


References: 
 >Obj-C with C problems (From: Daniel Gregg <email@hidden>)

  • Prev by Date: Obj-C with C problems
  • Next by Date: Re: Obj-C with C problems
  • Previous by thread: Obj-C with C problems
  • Next by thread: Re: Obj-C with C problems
  • Index(es):
    • Date
    • Thread