Page 1 of 1

Objective-C

Posted: Mon Jan 17, 2011 12:20 pm
by irwansyah
Hi all!

Any one wether it is possible to develop homebrew using Objective-C? I've tried last night, managed to compiled it but failed when linking the object code because the linker can not find the Objective-C runtime.

Re: Objective-C

Posted: Thu Feb 10, 2011 6:16 pm
by WinterMute
Sorry to take so long answering this, been a bit busy with DSi related updates.

The objective C support is still a little experimental, I don't particularly know what I'm doing with objc but I thought it might be worth enabling the possibility to see what happened.

There are some rules in the base rules set for .m files but as yet I haven't added anything to the templates. This is just adding a couple of lines, first to pick up .m files add

Code: Select all

MFILES		:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.m)))
near the existing search commands for CFILES etc. Then further down add

Code: Select all

$(MFILES:.m=.o)
to the existing OFILES line.

From there you should just need to add -lobjc to the LIBS variable.

I didn't really get any further than a basic objective C hello world with this so I'd be interested in knowing how you get on.

Re: Objective-C

Posted: Sun Feb 20, 2011 11:16 pm
by GSGeek
Hello,

To my knowledge, only one DS homebrew project was done with ObjC: DSCent. That involved porting the famous Descent, a 3D first-person shooter game from PC/Mac platform to the DS. It is amazingly playable but, in my case, the game was unstable: it hung often on the transitions from one level to the next one.

If I remember well, the developer chose the Mac version of the game because it was written in Objective-C. The PC version had too many modules written in assembler! The problem is that his work never got published or publicized.

I'm trying on my side to bring ObjC out of 'Mac' world. Some efforts have been made in that way: ObjC Eclipse plugin (but for Macs only), GNUStep libraries and Darwin (Unix-like OS and open-source cousin of MacOS but things move slowly because of lack of interest from the open-source dev community. If you own a Mac then you've got something to start with. Otherwise, it's a longer way to get ObjC going on non-iDevice platforms.

I hope it will happen someday...

Re: Objective-C

Posted: Wed Nov 21, 2012 3:34 am
by cylax
Hi! Anyone get this working?

Re: Objective-C

Posted: Wed Nov 21, 2012 9:19 pm
by cylax
So, I tried without success, it compiles, but in desmume nothing happen and in DS, it turn it off when launched. It was a very simple program.

Re: Objective-C

Posted: Tue Dec 11, 2012 12:07 am
by WinterMute
You'll need to put an infinite loop in your main function. If you're launching from hbmenu or another menu that supports the feature then either a return from main or exit(0) will return to the menu. If the feature isn't supported then the DS will power off.