Skip to main content

Thread: Objective C programing


i'm trying learn objective c, book stephen kochan, programing in objective c 2.0. i'd able alot of learning away mac. i've been playing last 2 days gnustep windows , ubuntu. i'm not looking special, book takes writing first program output - "programing fun" through portion of objective c.

problem seems libraries (i think). following work under gnustep windows (compile , run)

code:
//first example #import <foundation/foundation.h>  int main (int argc, const char * argv[]) {                      nsautoreleasepool * pool = [[nsautoreleasepool alloc] init];   nslog (@"programming fun!");    [pool release];   return 0; }      ~                                                                                ~                                                                                ~
except had change , specify actual directory foundation file resides.

can't compile on ubuntu. i've installed of packages think needed based upon reading alot of posts.

thoughts.?

compiling code on ubuntu gives me these errors:

monica@dell-laptop:~/progs$ gcc prog1.m -o prog1 -lobjc
prog1.m:2:34: error: foundation/foundation.h: no such file or directory
prog1.m: in function ‘main’:
prog1.m:7: error: ‘nsautoreleasepool’ undeclared (first use in function)
prog1.m:7: error: (each undeclared identifier reported once
prog1.m:7: error: each function appears in.)
prog1.m:7: error: ‘pool’ undeclared (first use in function)
prog1.m:8: error: cannot find interface declaration ‘nxconstantstring’

code post compile couldn't program run.

you have link gnustep base library , tell compiler headers are.

code:
gcc -o whatever whatever.m -i/usr/include/gnustep -lobjc -l/usr/lib/gnustep -lgnustep-base
usually, 1 uses gnustep's makefiles compile, actually. @ http://www.gnustep.org/resources/doc...anual_toc.html

status of openstep is rather confusing. isn't "objective-c standard library" c or c++ std. libs. are, turns out productive in objective-c, need openstep...

code in how-to without gnustep... may post appendix


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk Objective C programing


Ubuntu

Comments

Popular posts from this blog

Convierte tu Raspberry en un NAS. Firmware fvdw-sl 15.3 - Raspberry Pi Forums

How to format a Get Request

avrdude: verification error, first mismatch at byte 0x0000 0x0c != 0x62