object-c编译

例子1:

WordLength1.m

#import <Foundation/Foundation.h>

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

	const char *words[4] = {"aardvark", "abacus",
					"allude", "zygote"};

	int wordCount = 4;

	int i;
	for(i = 0; i < wordCount; i++) {
		
		NSLog (@"%s is %d characters long",
			words[i], strlen(words[i])	);

		}

		return (0);

}



WordLength1.sh脚本文件

#!/bin/sh

# Last Change:  2012-04-04 01:03:13
gcc -o WordLenght1 WordLenght1.m \
-fconstant-string-class=NSConstantString \
-I /GNUstep/System/Library/Headers/ \
-L /GNUstep/System/Library/Libraries/ \
-lobjc \
-lgnustep-base





你可能感兴趣的:(code)