Well I got the book, Programing in Objective-C by Stephen G. Kochan, and im having a problem with the part of the book that deals with compiling your first program in terminal.
I have a file named main.m with a sample code shown bellow
then I try to compile it using the command shown in the book (command from book bellow this)
gcc main.m -o myprogram -1 objc Compile main.m & call it myprogram
and I get this error
But when I use just
gcc main.m -o myprogram
it compiles without errors and I get the executable file in the MySrc directory, Why does the command from the book give me erros but when I remove "-1 objc Compile main.m & call it myprogram" it works
I have a file named main.m with a sample code shown bellow
Code:
// first program example
#import <stdio.h>
int main (int argc, const char *argv[])
{
printf ("Programing is ****ing funerific. \n");
return 0;
}
then I try to compile it using the command shown in the book (command from book bellow this)
gcc main.m -o myprogram -1 objc Compile main.m & call it myprogram
and I get this error
Code:
[1] 1351
-bash: call: command not found
myname-myname-laptopname-2:MySrc supersteve9219$ i686-apple-darwin9-gcc-4.0.1: main.m: No such file or directory
i686-apple-darwin9-gcc-4.0.1: objc: No such file or directory
i686-apple-darwin9-gcc-4.0.1: Compile: No such file or directory
i686-apple-darwin9-gcc-4.0.1: main.m: No such file or directory
i686-apple-darwin9-gcc-4.0.1: no input files
But when I use just
gcc main.m -o myprogram
it compiles without errors and I get the executable file in the MySrc directory, Why does the command from the book give me erros but when I remove "-1 objc Compile main.m & call it myprogram" it works