[cfe-dev] Objective-C headers code in Linux

cheer_xiao xiaqqaix at gmail.com
Sun Jan 9 03:47:18 PST 2011


Hi,
I've been using Clang for quite a while now and recently I'm trying
out Objective-C. While a simple "hello world"

#import <stdio.h>
int main() {
    printf("Hello world!\n");
    return 0;
}

compiles without complaints from clang, attempts to import
Objective-C-specific headers, like

#import <obj/Object.h>

results in an error like:

./Point.h:1:9: fatal error: 'objc/Object.h' file not found

(FYI, I'm following the Wikibooks tutorial on Objective-C:
http://en.wikibooks.org/wiki/Objective-C_Programming) It's clear that
I don't have the headers. But I have done a lot of Googles and got
stuck there - no hints on getting those Objective-C headers on Linux.
An solutions? BTW, Does there exist any alternative set of standard
library headers(other than the ones shipped with glibc) on Linux? If
there is, how do I have clang use them? I know that I'd better use the
more "native" glibc ones, but I'm just trying out.

I run Ubuntu 10.04 on my laptop. I have tried installing packages
gobjc-4.4 and libobjc2, hoping to get headers from it, but that
doesn't seem to work at all.



More information about the cfe-dev mailing list