clang 3.4 with ubuntu server 3.10 for objective-c 2 development?

hello,

i am new to this list as well as everything related to clang/llvm and obj-c.

i wish to do objective-c 2 development under ubuntu server 3.10 and googling around has shown clang 3.4 to be the most ideal compiler set.

installed clang 3.4 via 'apt-get' and tried compiling a simple "hello, world" sample (mentioned below) but the compiler threw up a whole lot of errors.

//--------- begin ---------
@interface Hello:NSObject
- (void) say;
@end
@implementation Hello
- (void) say {
    NSLog(@"Hello, world!");
}
@end

int main(int argc, char *argv[])
{
     @autoreleasepool {;
         [[Hello new] say];
     }
     return 0;
}
//------------ end -------------

i'm sure there's something more i need to install other than just clang 3.4.
may i know what else?

thanks,

~mayuresh

Clang doesn't come with the libraries you're trying to use. Get them like so:

sudo apt-get install gnustep gnustep-devel

If you still have problems, provide your command line and the error, it will make it much easier to work out what's wrong.

Ben

Do you think that should be a hard dependency of the Debian/Ubuntu
package or a recommendation of the package ?

Thanks,
Sylvestre

It's definitely not a requirement on linux, I use clang for C++, not Objective C, and certainly not Objective-C libraries. On my system the above command would install 63 additional packages and take 135MB.

I guess GNUstep is to Objective C what QT is C++?

I'm not an Objective C kinda guy, the above statement is probably completely wrong :stuck_out_tongue:

Whilst I have your attention, can you package libc++ built against libc++abi? That would be awesome :slight_smile:

Ben

Hi Sylvestre,

'Suggests' or 'recommends' would be fine, but please don't make it a
hard dependency. A lot of Linux users don't use Clang for
Objective-C, and requiring them to install gnustep (does it pull in
Xorg as well?) would be causing unnecessary trouble.

Dmitri

Note that this combination most likely won't work with Objective-C. Objective-C++ exceptions (on non-Darwin systems) rely on the ability to register new typeinfo objects and have them slot into the matching system. This works with libsupc++ and libcxxrt, but not libc++abi, because libc++abi changed some parts of the GNU ABI in an incompatible way.

David

in that case, do I really need gnustep to learn objective c 2 programming?
i plan to work through kochan's book on objective c (6th edition).

at the moment, i am testing the waters, hence am making do with my x86-64 based machine running ubuntu server 13.10, once i get confident about obj-c 2, i will be investing in a macintosh. :slight_smile:

~mayuresh

Do you think that should be a hard dependency of the Debian/Ubuntu
package or a recommendation of the package ?

It's definitely not a requirement on linux, I use clang for C++, not
Objective C, and certainly not Objective-C libraries. On my system
the above command would install 63 additional packages and take 135MB.

OK, Suggests will be a good then.

Whilst I have your attention, can you package libc++ built against
libc++abi? That would be awesome :slight_smile:

What is wrong with the package already available:
http://packages.qa.debian.org/libc/libc++.html ?

(I might be missing your point)

Cheers,
Sylvestre