Skip to content

Instantly share code, notes, and snippets.

@jorbsd
Created January 23, 2010 18:32
Show Gist options
  • Save jorbsd/284725 to your computer and use it in GitHub Desktop.
Save jorbsd/284725 to your computer and use it in GitHub Desktop.
18 jordan@thetourist /tmp > g++ -fobjc-gc-only -o test test.mm
test.mm: In function ‘int main(int, char**)’:
test.mm:4: error: ‘objc_collectingEnabled’ was not declared in this scope
test.mm:5: error: ‘objc_startCollectorThread’ was not declared in this scope
#import <Foundation/Foundation.h>
int main(int argc, char *argv[]) {
if (objc_collectingEnabled()) {
objc_startCollectorThread();
}
NSAutoreleasePool *mainPool = [[NSAutoreleasePool alloc] init];
[mainPool drain];
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment