Objective-C

support for the ARM toolchain
Post Reply
irwansyah
Posts: 1
Joined: Sun Nov 14, 2010 8:56 am

Objective-C

Post by irwansyah » Mon Jan 17, 2011 12:20 pm

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.

WinterMute
Site Admin
Posts: 1860
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Objective-C

Post by WinterMute » Thu Feb 10, 2011 6:16 pm

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.
Help keep devkitPro toolchains free, Donate today

Personal Blog

GSGeek
Posts: 4
Joined: Wed Jun 02, 2010 4:44 pm

Re: Objective-C

Post by GSGeek » Sun Feb 20, 2011 11:16 pm

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...

cylax
Posts: 2
Joined: Wed Nov 21, 2012 3:33 am

Re: Objective-C

Post by cylax » Wed Nov 21, 2012 3:34 am

Hi! Anyone get this working?

cylax
Posts: 2
Joined: Wed Nov 21, 2012 3:33 am

Re: Objective-C

Post by cylax » Wed Nov 21, 2012 9:19 pm

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.

WinterMute
Site Admin
Posts: 1860
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Objective-C

Post by WinterMute » Tue Dec 11, 2012 12:07 am

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.
Help keep devkitPro toolchains free, Donate today

Personal Blog

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest