[Note] GNUstep on Windows

1.下载与安装

www.gnustep.org/windows/installer.html

下载

GNUstep MSYS System

GNUstep Core

GNUstep Devel

并安装,全部安装在同一个文件夹下,如D:/GNUstep

2.配置

2.1 配置Compiler

Settings -> Compiler

 Linker settings

Search directories

Toolchain exectables

 Other compiler options

-fconstant-string-class=NSConstantString -std=c99

2.2 其他配置

Editor

@interface @implementation @end  @class @selector @protocol @public @protected @private id BOOL YES NO SEL nil  NULL self

 添加关键字

为了能objective-c代码能着色,给objective-c的Filemasks增加*.m, 删除Matlab的*.m,这样IDE就能识别出*.m是objective-c文件了

新建一个Project

 添加*.m到Source目录

 3.测试

 再新建一个Console Application项目,删除自带的main.c(去File Explorer里删),添加一个main.m,如果发现main.m是灰色的,点Build也没反应

-------------- Clean: Debug in objective (compiler: GNUstep GCC Compiler)---------------

Cleaned "objective - Debug"

-------------- Build: Debug in objective (compiler: GNUstep GCC Compiler)---------------

Linking stage skipped (build target has no object files to link)
Nothing to be done (all items are up-to-date).

 在main.m上右键, 选中Compile file 和 Link file,再次编译

ALL CLEAR!

Updated 2018-3-26 18:47

发现新增一个Fraction.h头文件和对应的Fraction.m文件后无法通过编译

将main.m 和 Fraction.m的 Compiler variable 改成 CC或者CPP

Fraction.h 的Compiler variable 改成 OBJC 

Properties-->Advanced-->Compiler variable

务必记得每个.m和.h文件都要这么做

参考链接

https://blog.csdn.net/ldl22847/article/details/7482971

http://www.programering.com/a/MTNyczMwATY.html

http://www.voidcn.com/article/p-nmxwqrlk-tz.html

原文地址:https://www.cnblogs.com/arcsinw/p/8650970.html