[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Objective-C newbie programming question
From: |
Dennis Leeuw |
Subject: |
Re: Objective-C newbie programming question |
Date: |
Fri, 17 Jan 2003 16:46:19 +0100 |
Hi all,
Thanks for the quick responses.
It all works now ;)
I mixed commands from different sources and you already guessed that I
haven't the slightest idea of what I am doing...
But now I do, a little more.
Dennis
Andy Ruder wrote:
>
> On Fri, Jan 17, 2003 at 04:05:14PM +0100, Dennis Leeuw wrote:
> >
> > bash-2.05a$ gcc -c hello.m -lobjc
> > hello.m: In function `main':
> > hello.m:24: warning: return type of `main' is not `int'
> > gcc: -lobjc: linker input file unused because linking not done
>
> Some compilers insist on main() returning int or they give a warning.
> In this case, you would just change it to return int, and then put
> return 0; at the end of the main() function so that it doesn't complain.
>
> Also, -c instructs the compiler not to link it and to just compile the
> .o (object) file. .o files are just the building blocks of an executable,
> and cannot be run until you have linked them.
>
> Just get rid of the -c and then add a -o hello:
>
> gcc hello.m -o hello -lobjc
>
> should work fine if you have everything set up correctly.
>
> Then run with:
>
> ./hello
>
> - Andrew Ruder