欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

object-c编译

程序员文章站 2022-03-22 08:10:22
...
例子1:

[size=large][b]WordLength1.m[/b][/size]

#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);

}



[b][size=large]WordLength1.sh脚本文件[/size][/b]

#!/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