1
votes

I am a newbie to Objective C programs. I'm learning to code from tutorialspoint.com As mentioned therein I downloaded GNUstep (Windows). First, installed the MSYS/MinGW System package and then core package. After that followed the steps mentioned there. I created a simple program with name hello.m and Stored that in C drive (Snapshot 1) I don't know the meaning of this command below but entered it:

$ gcc gnustep-config --objc-flags -L /GNUstep/System/Library/Libraries hello.m -o hello -lgnustep-base -lobjc

The error it shows is - sh: gcc: command not found

Please help with the same, to compile and run my first Objective C program

1
@deimus As you said I have downloaded TDM-GCC (and installed) from the link you provided. Now during compilation of my file it shows - "gcc.exe: error: hello.m: No such file or directory" Is there any specific location at which I should place the file ?? Where I am going wrong ?? Please help - Vishal Jaiswar
You should run the compilation command from the same directory where the hello.m file is. - deimus
@deimus I have stored the files of GNUstep and that of TDM GCC @ C:\ (C drive) and I have created a folder in C directory called "Project" (in which I have stored file hello.m). So, basically GNUstep, TDM-GCC and the Project folder lies at the same location i.e. C:\. My command is - $ gcc gnustep-config --objc-flags -L /GNUstep/System/Library/Libraries hello.m -o hello -lgnustep-base -lobjc What changes should I make here ?? - Vishal Jaiswar
navigate to the folder where the hello.m file is with cd command and run the same compilation command from there - deimus
@deimus Yeah, did that. I navigated to that folder where my file hello.m is stored by 'cd' command. After that again when I put - $ gcc gnustep-config --objc-flags -L /GNUstep/System/Library/Libraries hello.m -o hello -lgnustep-base -lobjc Now it shows gcc.exe: error: CreateProcess: No such file or directory I would be really helpful if you get me out of this mess...:) - Vishal Jaiswar

1 Answers

1
votes

gcc is the compiler, the other parameters are for compiling objective-c code.

Apparently you have misconfiguration in MSYS/MinGW setup.

Check out following post which has alternative and easier solution for running gcc under Windows.