On Oct 30, 2014, at 23:13:000, Mayuresh Kathe wrote:

is there any document/web-page i could refer to for a set of steps to
adhere to while compiling obj-c (pre-v2) code?
yes, i finally decided on my platform (netbsd) and language (obj-c),
and as advised have got a copy of the 'oop' book by mr. brad cox.
just that a simple helloworld.h snippet refuses to compile.
#import <stdio.h>
#import <Foundation/Foundation.h>

int main(void) {
        NSLog(@"Hello, World!\n");
        return 0;
}


any help would be appreciated. :)
thanks,
-mayuresh


Hi,

You didn't mention what commands you used to try to compile, but it should work -- on OS-X -- in the form:
        gcc -o helloworld -lobjc -framework Foundation helloworld.m
(and yes, it should be helloworld.m -- compile the implementation file, not the interface)

However, you have a platform issue here....
In practice, Objective-C is, and increasingly so, linked to a particular platform, and its associated code libraries/frameworks.
For the most part there is only one such platform in use -- Apple's.
NSLog(), and the whole Foundation Library (not to mention AppKit) are only available on Mac OS-X.

Since you are using Net-BSD you are in a difficult spot.
There is a project out there -- GNUStep (gnustep.org) -- which has successfully (and so far as I know continues) to operate an open- source equivalent for Windows, Linux, BSD, and to some extent, OS-X systems. If your interest is in developing actual applications with Obj-C you will almost certainly want to check into that project. That will not be easy though, as their development community is small and the facilities for installing GNUStep don't get much development time.
I have tried getting GNUStep operational on Fedora, but gave up.

If you are not otherwise particular about your platform, I suggest just getting a Mac instead, as the whole development tool-chain is free and easily installed, and of course a good environment in which to practice, and get results.

If you must continue using Net-BSD for Obj-C development, but are not ready to use GNUStep, you may be able to get started with just command- line apps by installing libFoundation,
(http://www.webweavertech.com/libFoundation/)
which is an open-source clone of Apple's Foundation framework (but it is not compatible with GNUStep).

Further, and a critical first step,
since Obj-C is not a normal language of choice on non-Apple platforms, you will almost certainly also have to get your package manager to install the Obj-C components of GCC, which are normally left out.


Manoah F. Adams
federaladamsfamily.com/developer

===========




Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/objc-language/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to