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)
except had change , specify actual directory foundation file resides.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; } ~ ~ ~
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.
usually, 1 uses gnustep's makefiles compile, actually. @ http://www.gnustep.org/resources/doc...anual_toc.htmlcode:gcc -o whatever whatever.m -i/usr/include/gnustep -lobjc -l/usr/lib/gnustep -lgnustep-base
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
Post a Comment