自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Objective-C開發(fā)之CodeBlocks實例操作

移動開發(fā) iOS
本文介紹的是在Objective-C實現(xiàn)CodeBlocks的實例操作,主要講述了CodeBlocks相關(guān)的內(nèi)容,先來看詳細內(nèi)容。

Objective-C開發(fā)之CodeBlocks實例操作的內(nèi)容是本文要介紹的內(nèi)容,主要講述了CodeBlocks相關(guān)的內(nèi)容,先來看詳細內(nèi)容。

1. 首先安裝Objective-C編譯器

GNUstep Windows Installer提供了Windows平臺下的Objective-C的模擬開發(fā)環(huán)境,一共有四個軟件包,其中GNUstep System和GNUstep Core是必裝的,GNUstep Devel和Cairo Backend是選裝的。甭管必裝選裝,一次性全安上,免得以后麻煩。

四個文件都安裝到C:GNUstep下

  1. http://ftpmain.gnustep.org/pub/gnustep/binaries/windows/gnustep-msys-system-0.25.1-setup.exe  
  2.  
  3. http://ftpmain.gnustep.org/pub/gnustep/binaries/windows/gnustep-core-0.25.0-setup.exe  
  4.  
  5. http://ftpmain.gnustep.org/pub/gnustep/binaries/windows/gnustep-devel-1.1.1-setup.exe  
  6.  
  7. http://ftpmain.gnustep.org/pub/gnustep/binaries/windows/gnustep-cairo-0.22.1-setup.exe 

2. 為Code::Blocks添加編譯器

打開Code::Blocks,點擊菜單Settings>Compiler and debugger>Global compiler settings

在Selected compiler下拉框下面點擊Copy, 在彈出窗口中填入: GNUstep MinGW Compiler

之后,點擊Toolchain executables選項卡,將Compiler’s installation directory選擇為C:GNUstepmingwbin

3. 創(chuàng)建Objective-C工程

創(chuàng)建一個Console的C工程,將main.c刪除,新建main.m文件,內(nèi)容如下:

  1. #import <Foundation/Foundation.h> 
  2. int main (int argc, const char *argv[]) {  
  3.     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];  
  4.     NSLog(@"Hello World!");  
  5.     [pool drain];  
  6.     return 0;  

右擊main.m點擊property,選擇Build選項卡,將Compile file與Link file都打上勾,選擇Advanced,將Compiler variable的內(nèi)容改為CC

4. 設(shè)置編譯選項

(1)方法一

右擊將創(chuàng)建的工程,選擇Build options…,Selected compiler編譯器選擇GNUstep MinGW Compiler, 選擇Compiler settings>Other options中填入-fconstant-string-class=NSConstantString

選擇Linker settings選項卡,點擊Add,增加如下兩行內(nèi)容:

  1. C:/GNUstep/GNUstep/System/Library/Libraries/libobjc.dll.a  
  2. C:/GNUstep/GNUstep/System/Library/Libraries/libgnustep-base.dll.a 

選擇Search directories>Compiler,點擊Add,增加如下內(nèi)容:

  1. C:/GNUstep/GNUstep/System/Library/Headers 

(2)方法二

右擊將創(chuàng)建的工程,選擇Build options…,Selected compiler編譯器選擇GNUstep MinGW Compiler, 選擇Compiler settings>Other options中填入

  1. -fconstant-string-class=NSConstantString -IC:/GNUstep/GNUstep/System/Library/Headers  
  2.    -LC:/GNUstep/GNUstep/System/Library/Libraries 

選擇Linker settings選項卡,在Other linker options中輸入-lobjc -lgnustep-base即可

5. 增加.m文件類型高亮及編輯器關(guān)聯(lián)

(1)點擊Settings>Editors>Syntax highlighting, 選擇Syntax highlighting for: C/C++,點擊Filemasks…,在彈出窗口里面加入*.m,點OK
選擇Matlab,點擊Filemasks…,將里面的*.m刪除

(2)點擊Settings>Environment>Files extension handling,點擊*.m,在To open the file中選擇

Open it in a Code::Blocks editor即可。

小結(jié):Objective-C開發(fā)之CodeBlocks實例操作的內(nèi)容介紹完了,希望本文對你有所幫助!

責任編輯:zhaolei 來源: 互聯(lián)網(wǎng)
相關(guān)推薦

2011-08-04 09:47:33

iOS Objective- JavaScript

2011-07-29 15:47:21

iPhone開發(fā) Objective- C

2014-09-26 09:49:48

SwiftObjective-C

2011-07-28 15:11:23

iOS Objective-

2013-05-02 10:51:17

iOS開發(fā)Objective-C@property

2013-07-24 19:19:03

Objective-CiOS開發(fā)動態(tài)特性之protoc

2014-04-01 10:50:42

iOS開發(fā)runtimeObjective-C

2011-04-08 10:51:17

Objective-CiOS

2013-03-27 12:54:00

iOS開發(fā)Objective-C

2013-06-20 10:40:32

Objective-C實現(xiàn)截圖

2011-05-11 11:20:26

Objective-C

2011-05-11 15:58:34

Objective-C

2011-08-09 15:53:28

2011-08-10 18:07:29

Objective-C反射

2011-08-04 10:04:17

Objective-C 分類 協(xié)議

2011-07-27 17:41:35

Objective-C Xcode

2011-07-07 17:04:33

iPhone Action Objective-

2011-07-18 14:59:20

iPhone Objective-

2012-04-23 11:00:56

iOS開發(fā)Objective-CJavaScript

2011-07-08 13:49:46

Objective-C UUID
點贊
收藏

51CTO技術(shù)棧公眾號