1

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

  • @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 Jul 03 '15 at 14:16
  • You should run the compilation command from the same directory where the `hello.m` file is. – deimus Jul 03 '15 at 14:19
  • @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 Jul 03 '15 at 14:29
  • navigate to the folder where the `hello.m` file is with `cd` command and run the same compilation command from there – deimus Jul 03 '15 at 14:36
  • @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 Jul 03 '15 at 14:46
  • man, this is already out of the scope of your question here, please try to find and fix small problems on your own, and in case your stuck somewhere ask another question here. Sorry but I've to go home already, its Friday ;) Happy weekend ! Also have a look at this step by step guideline on who to compile objective-c code on Windows http://sweettutos.com/2012/08/11/objective-c-on-windows-yes-you-can/ – deimus Jul 03 '15 at 14:50
  • @deimus Happy Weekend, Thanks :) – Vishal Jaiswar Jul 03 '15 at 14:56

1 Answers1

1

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.

Community
  • 1
  • 1
deimus
  • 9,565
  • 12
  • 63
  • 107