zoukankan      html  css  js  c++  java
  • Objective C for Windows

    You can use Objective C inside the Windows environment. If you follow these steps, it should be working just fine:

    1. Visit the GNUstep website and download GNUstep MSYS Subsystem (MSYS for GNUstep), GNUstep Core (Libraries for GNUstep), and GNUstep Devel
    2. After downloading these files, install in that order, or you will have problems with configuration
    3. Navigate to C:GNUstepGNUstepSystemLibraryHeadersFoundation1 and ensure thatFoundation.h exists
    4. Open up a command prompt and run gcc -v to check that GNUstep MSYS is correctly installed (if you get a file not found error, ensure that the bin folder of GNUstep MSYS is in your PATH)
    5. Use this simple "Hello World" program to test GNUstep's functionality:

      #import <Foundation/Foundation.h>
      
      int main(int argc, char**argv)
      {
      NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
      
      NSLog(@"headfile dir is ok
      ");
      
      [pool release];
      
      return 0;
      }
       
    6. Go back to the command prompt and cd to where you saved the "Hello World" program and then compile it:2

      gcc -o helloworld.exe <HELLOWORLD>.m -I /GNUstep/GNUstep/System/Library/Headers-L /GNUstep/GNUstep/System/Library/Libraries-std=c99 -lobjc -lgnustep-base -fconstant-string-class=NSConstantString
    7. Finally, from the command prompt, type helloworld to run it

    All the best, and have fun with Objective-C!

  • 相关阅读:
    hdu 4297 One and One Story 夜
    hdu 4280 Island Transport 夜
    1389. Roadworks 夜
    hdu 4289 Control 夜
    hdu 4291 A Short problem 夜
    hdu 4284 Travel 夜
    1080. Map Coloring 夜
    正则中的转义符\
    起重复出现作用的量词*和+
    安卓的权限大全和动态使用安卓权限
  • 原文地址:https://www.cnblogs.com/xiangshancuizhu/p/3387279.html
Copyright © 2011-2022 走看看