gnustep

Unable to compile Objective-C code on Ubuntu

微笑、不失礼 提交于 2019-12-11 10:23:31
问题 So I have this piece of code... /** * cdb.m * Copyright (C) 2013 Naveen Mathew. All rights reserved. */ #import <objc/Object.h> #import "cdb.h" #import <stdio.h> #import <stdlib.h> @implementation CDB : Object { } - (int) main { printf("Hello world"); return 0; } @end int main(void) { CDB *myNumber = [CDB new]; // equal to [[Number alloc] init] [myNumber main]; return 0; } and I want to compile it in Ubuntu 13.04 but without all the crap that GNUStep gives me. So I use the GNU Objective C

How can i use Objective-C's Property feature in GNUstep?

南笙酒味 提交于 2019-12-10 11:09:01
问题 I'm trying to use Objective-C 2.0 feature Property in GNUstep(using Windows). But i can't use @property sign and @synthesize. Although All of my codes are correct,compiler can't compile my property code. Compiler also can't understand "@" sign. Can i use Property feature in GNUstep. If it's can use,Please tell me how can i do that? Thanks you for your time. 回答1: The GNUStep GCC compiler does not support @property (or any of the the other Objective-C 2.0 language changes). However, if you can

Unable to Compile Objective C using Gnustep on windows

流过昼夜 提交于 2019-12-08 01:34:40
问题 Hi i am a beginner learning objective c. i am finding an error "hello.m:1:34: Foundation/Foundation.h: No such file or directory" i came to know that i need to make a make file may i know how to make the make file please 回答1: No need to create a makefile. If you start MinGW from "All Programs -> GNUstep -> Shell" as Pax indicates above, you can just compile your .m file. My GNUstep installation is in c:\GNUstep\GNUstep\System. If yours is different, you should change the import of Foundation

Automating GNUStep from Notepad++

房东的猫 提交于 2019-12-07 11:20:52
问题 I use GNUStep to compile Objective-C on Windows 7 using GCC and MinGW. I'd like to be able to automate the "make" instruction (with make files) from Notepad++ and have any complier errors reported to Notepad++s console window. Edit: What I am trying to do is script GNUStep/Bash to login to the right directory, build the directory, then exit. Currently I have to type in the following: sh -login -i $ cd d:\directory $ make Does anyone have any experience with this? Rich 回答1: The npp-plugins

Segmentation fault when attemping to print NSString as UTF8String

大城市里の小女人 提交于 2019-12-06 10:29:01
I have the following objective-c snippet in my hello world example: //hello.m #import <Foundation/Foundation.h> #import "hello.h" void sayHello() { #ifdef FRENCH NSString *helloWorld = @"Bonjour Monde!\n"; #else NSString *helloWorld = @"Hello World\n"; #endif printf("%s", [helloWorld UTF8String]); } //main.m #import <Foundation/Foundation.h> #import "hello.h" int main (int argc, const char * argv[]) { sayHello(); return 0; } building this stuff on osx works fine and runs as expected. But when compiling/linking it on ubuntu (using GNUStep) results in an segmentation fault when executing the

Linux Clang and Objective-C base library

☆樱花仙子☆ 提交于 2019-12-06 10:02:56
I have been experimenting with Objective-C using GCC + GNUstep on an Ubuntu system. Now regarding the LLVM Clang compiler, what kind of *step library does it offer? Does it use the GNUstep on the Apple Cocoa? I am mostly interested in the base library - collections, streams, etc. The website doesn't give much information. LLVM Clang is a compiler. It is completely independent from the Cocoa / Cocoa Touch frameworks on OS X / iOS, or any other frameworks or platform, for that matter. Like MKroehnert and puzzle said, neither LLVM Clang nor GCC actually come with a set of frameworks. GCC comes

Unable to Compile Objective C using Gnustep on windows

痞子三分冷 提交于 2019-12-06 09:38:39
Hi i am a beginner learning objective c. i am finding an error "hello.m:1:34: Foundation/Foundation.h: No such file or directory" i came to know that i need to make a make file may i know how to make the make file please No need to create a makefile. If you start MinGW from "All Programs -> GNUstep -> Shell" as Pax indicates above, you can just compile your .m file. My GNUstep installation is in c:\GNUstep\GNUstep\System. If yours is different, you should change the import of Foundation.h accordingly. I did this: Create c:\myprogs\obj-c\hello\hello.m that looks like this: //---------- Hello.m

探秘Runtime

∥☆過路亽.° 提交于 2019-12-06 00:32:21
该文章属于<简书 — 刘小壮>原创,转载请注明: <简书 — 刘小壮> https://www.jianshu.com/p/3019605a4fc9 本文基于 objc-723 版本,在 Apple Github 和 Apple OpenSource 上有源码,但是需要自己编译。 重点来了~ ,可以到我的 Github 上下载编译好的源码,源码中已经写了大量的注释,方便读者研究。(如果觉得还不错,各位大佬麻烦点个 Star ) Runtime Analyze 对象的初始化流程 在对象初始化的时候,一般都会调用 alloc+init 方法实例化,或者通过 new 方法进行实例化。下面将会分析通过 alloc+init 的方式实例化的过程,以下代码都是关键代码。 前面两步很简单,都是直接进行函数调用。 + (id)alloc { return _objc_rootAlloc(self); } id _objc_rootAlloc(Class cls) { return callAlloc(cls, false/*checkNil*/, true/*allocWithZone*/); } 在创建对象的地方有两种方式,一种是通过 calloc 开辟内存,然后通过 initInstanceIsa 函数初始化这块内存。第二种是直接调用 class_createInstance 函数

Automating GNUStep from Notepad++

会有一股神秘感。 提交于 2019-12-05 16:03:19
I use GNUStep to compile Objective-C on Windows 7 using GCC and MinGW. I'd like to be able to automate the "make" instruction (with make files) from Notepad++ and have any complier errors reported to Notepad++s console window. Edit: What I am trying to do is script GNUStep/Bash to login to the right directory, build the directory, then exit. Currently I have to type in the following: sh -login -i $ cd d:\directory $ make Does anyone have any experience with this? Rich The npp-plugins gives you most of what you are looking for. Install the plugin and: Press F6 to open the NppExec Execute window

Compiling Objective-C app for Linux (API coverage)

泄露秘密 提交于 2019-12-04 14:57:32
I might be asking something strange here, but I'm unsure where to begin. The thing is that I am considering writing a command line tool on a Mac using Obj-C and the Foundation classes. But there is a very big risk that I would like to be able to compile it for different Linux distributions to run as a server app in the future. I understand that it is not a problem in itself to compile Objective-C for Linux, but what I don't understand is the API coverage. As I have understood it so far I can use GNUStep to compile for linux, but is there a good way for me to get an overview of the API coverage