zoukankan      html  css  js  c++  java
  • 如何在 linux 上寫 ObjectiveC 程式

    http://chchwy.blogspot.com/2010/05/linux-objective-c.html

    如何在 linux 上寫 Objective-C 程式

    1. 依序安裝以下packages:

    sudo apt-get -y install build-essential
    sudo apt-get -y install gnustep
    sudo apt-get install gobjc
    sudo apt-get install gnustep-make
    sudo apt-get install libgnustep-base-dev

    安裝完後,我們還需要一個命令才能編譯objc。由於這行命令每次運行terminal都需要打一次,所以最好把它加入.bashrc裡,每次登入都自動執行。

    . /usr/share/GNUstep/Makefiles/GNUstep.sh

    OK,現在萬事具備,馬上來測試第一個objc程式。

    //hello.m
    #import <foundation/foundation.h>

    int main (int argc, const char * argv[])
    {
        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

        NSLog (@"hello Obj-C!");
        [pool drain];
        return 0;
    }


    編譯:

    gcc `gnustep-config --objc-flags` -I /usr/include/GNUstep -lgnustep-base hello.m

    恭喜!你的第一個objc程式完成了。

    find / -name Foundation.h >1.txt

  • 相关阅读:
    消息队列设计
    抓包工具Fiddler
    分布式系统和CAP
    Topshelf组件
    Parallel.For
    MVC插件
    Azure Messaging-ServiceBus Messaging
    MVC
    requireJS
    第一次react-native项目实践要点总结 good
  • 原文地址:https://www.cnblogs.com/cutepig/p/2197815.html
Copyright © 2011-2022 走看看