3

ok i have this program here:

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

    NSLog (@"Hello world!");
    [pool drain];
    return 0;
}

the problem is when i compile it with the command "gcc -framework Foundation prog1.m -o prog1"

i get this: "gcc: error trying to exec 'cclobj' : execvp: No such file or Directory"

do i need to install any packages?? "

Ramy Al Zuhouri
  • 21,580
  • 26
  • 105
  • 187
pantelis5050
  • 31
  • 1
  • 2

2 Answers2

5

Its not the only way but GNUStep worked for me. For a good writeup on setting it up look here.

Note: Your exact error is listed about halfway down that page. Your missing package seems to be 'gobjc'.

Matt
  • 1,513
  • 3
  • 16
  • 32
  • ok i did what u said the only problem is, that , when i compile using this command "gcc -framework Foundation prog1.m -o prog1" i get the same error. But when i write "#import " on top of the file prog1.m and then compile it like this "gcc `gnustep-config --objc-flags` -lgnustep-base prog1.m -o hello" it works fine. what is the correct way to do it? help pls. – pantelis5050 Dec 26 '10 at 23:10
  • The way I understand it you should always use '#import' to load the frameworks just like you would '#include' in c++. The need to pass the frameworks in the command line depends on the tool you're using to compile and weather or not it needs the instruction or if it can determine the dependencies on its own. – Matt Dec 26 '10 at 23:52