Author Topic: Need help with code block and Objective C  (Read 4953 times)

newcoder

  • Guest
Need help with code block and Objective C
« on: March 17, 2006, 06:43:11 pm »
I am very new to this and need some help.  I want to use Code Block to write code and compile using Objective C.  I am using windows xp. I have the mingw compiler installed along with the objective c addins.  I can compile from a command line and all this is working fine, example 'program.m -o program -l objc.' I want to be able to do everything within an IDE. I downloaded Code Block today but am confused on how to set everything up so that I can create or add in my source.m code and have it compile using the compile command within Code Block.  Please any help will be greatly appreciated. 

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Need help with code block and Objective C
« Reply #1 on: March 17, 2006, 07:11:39 pm »
Look here: http://wiki.codeblocks.org/index.php?title=Installing_Fortran_Compiler

It should be 99% the same for Objective-C
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

newcoder

  • Guest
Re: Need help with code block and Objective C
« Reply #2 on: March 17, 2006, 10:48:54 pm »
I just tried using the fortran model suggested.  If my source is mycode.c it works okay but if i change it to a mycode.m following the directions I get a link error.  In the adlink I added -lobjc. The link error really makes no sense to me as I selected gcc.exe and not ming32++.exe for both c and link steps as the error message says.  I created a different model and called it objectiveC, set parameters as suggested, and I get this error message:

Linking console executable: C:\Documents and Settings\Ron\mysrc\console.exe
mingw32-g++.exe: .objs\pro2.5.o: No such file or directory
mingw32-g++.exe: no input files
Process terminated with status 1 (0 minutes, 0 seconds)


0 errors, 0 warnings

The same program compiles fine using the command line:
'gcc pro.m -o pro -l objc'

Any advise is appreciated :P



newcoder

  • Guest
Re: Need help with code block and Objective C
« Reply #3 on: March 17, 2006, 10:53:58 pm »
PS / Further this is very simple code I am just trying out to get the compiler/IDE to work and the code is:

#import <stdio.h>

int main (int argc, const char *argv[])

{

int value1, value2, sum;

v1 = 50;
v2 = 25;
sum = value1 + value2;

printf ("The sum of %i and %i is %i\n", v1, v2, sum);

return 0;
}