Code::Blocks?

support for the ARM toolchain
Post Reply
Dr. Kylstein
Posts: 8
Joined: Sat Apr 18, 2009 11:12 pm

Code::Blocks?

Post by Dr. Kylstein » Fri Apr 24, 2009 1:20 am

How can I setup Code::Blocks to use devkitARM? I would like to be able to create a project that can be compiled for either PC or DS.

weirdfox
Posts: 29
Joined: Thu Feb 19, 2009 8:45 am
Location: Montreal, Canada
Contact:

Re: Code::Blocks?

Post by weirdfox » Fri Apr 24, 2009 3:39 am

There is multiple way, but the easiest is to tell Code::Blocks to use your devkitARM makefile instead of it's internal builders.

Right-click on your project -> "Properties..." -> Select "This is a custom Makefile"

I've been using this method to build my libnds project on Windows and Linux.

Another way would be to configure your DevkitARM as a custom compiler:
"Settings" -> "Compilers and debugger..."
But this will require a lot of customization as DevkitARM's makefile does a lot of work in the background.
try, crash, debug and learn :)

Dr. Kylstein
Posts: 8
Joined: Sat Apr 18, 2009 11:12 pm

Re: Code::Blocks?

Post by Dr. Kylstein » Fri Apr 24, 2009 4:07 am

weirdfox wrote:There is multiple way, but the easiest is to tell Code::Blocks to use your devkitARM makefile instead of it's internal builders.

Right-click on your project -> "Properties..." -> Select "This is a custom Makefile"

I've been using this method to build my libnds project on Windows and Linux.
Did you modify your makefile to handle the different platforms or do you just toggle that option?
weirdfox wrote:Another way would be to configure your DevkitARM as a custom compiler:
"Settings" -> "Compilers and debugger..."
But this will require a lot of customization as DevkitARM's makefile does a lot of work in the background.
So basically I would have to reverse-engineer the makefile?

weirdfox
Posts: 29
Joined: Thu Feb 19, 2009 8:45 am
Location: Montreal, Canada
Contact:

Re: Code::Blocks?

Post by weirdfox » Fri Apr 24, 2009 4:51 am

Dr. Kylstein wrote:Did you modify your makefile to handle the different platforms or do you just toggle that option?
No, just make sure the environment variables "DEVKITPRO" and "DEVKITARM" are set, that the devkit and libs are correctly installed on each system and the makefiles should work on linux and Windows.
Dr. Kylstein wrote: So basically I would have to reverse-engineer the makefile?
Yes, that's why I used the simple solution :)
try, crash, debug and learn :)

Dr. Kylstein
Posts: 8
Joined: Sat Apr 18, 2009 11:12 pm

Re: Code::Blocks?

Post by Dr. Kylstein » Sat Apr 25, 2009 12:37 am

weirdfox wrote: No, just make sure the environment variables "DEVKITPRO" and "DEVKITARM" are set, that the devkit and libs are correctly installed on each system and the makefiles should work on linux and Windows.
I think of all the PC/Mac variations as a single platform, I meant modifying the NDS makefile to handle compiling for PC.

Edit: It looks like you may have misunderstood me from the start. I'm working on a game engine that I think could work in large parts in both DS and PC games. I don't have any experience with makefiles, which is why I've been using Code::Blocks to take care of it for PC projects.

weirdfox
Posts: 29
Joined: Thu Feb 19, 2009 8:45 am
Location: Montreal, Canada
Contact:

Re: Code::Blocks?

Post by weirdfox » Sat Apr 25, 2009 3:19 pm

Ok, I now understand your problem...

For your situation, maybe the second solution would work best.
Having multiple compiler configured, you would be able to choose the right compiler for each build target
PC-Debug, PC-Release => GCC or MSVC
DS-Debug, DS-Release => DevkitARM
try, crash, debug and learn :)

Laethnes
Posts: 5
Joined: Sun Sep 27, 2009 8:31 am

Re: Code::Blocks?

Post by Laethnes » Sun Sep 27, 2009 8:39 am

I have same problem, but I can not set compiler in Code::Blocks right. All I did was setting "search directories" and "Toolchain executables". When I try compile project, obj files are created, but it cannot link. It writes some "undefined reference". I did set linker setting to link nds lib. I know, that compiled file is not an executable file (NDS), but I can not find (Google), what I have to do with generated file (when I compile it as static library, there is no error) to product final *.nds file. System variables are set right, because template makefile works fine.
I tryied read template makefile, but I can not understand from it, what I have to do and how to set Code::Blocks (I do not know makefiles at all). (I know, how to set it to use custom makefile, but I want to build like normal pc project.)
Do anyone know what to do, or where I can find needed info?
I'm on Windows XP. EDIT: And I would like to programe to nds.

User avatar
vuurrobin
Posts: 219
Joined: Fri Jul 11, 2008 8:49 pm
Location: The Netherlands
Contact:

Re: Code::Blocks?

Post by vuurrobin » Sun Sep 27, 2009 1:21 pm

its not really possible to create an nds project the same way as an pc project, because the makefile does more than just compile and link the files, like adding the arm7 binary and fixing the headers. using the makefile is the best way.


to use devkitARM with codeblocks, you need to tell codeblocks that you're using a custom makefile (instead of letting it compile on its own), where it can find the make program, and with what options to execute the make program.

its been a while since I did it, so its not really fresh in my mind.

Laethnes
Posts: 5
Joined: Sun Sep 27, 2009 8:31 am

Re: Code::Blocks?

Post by Laethnes » Sun Sep 27, 2009 3:03 pm

vuurrobin wrote:its not really possible to create an nds project the same way as an pc project, because the makefile does more than just compile and link the files, like adding the arm7 binary and fixing the headers. using the makefile is the best way.
Ah. It can not be done. Fine. Thanks.
vuurrobin wrote:to use devkitARM with codeblocks, you need to tell codeblocks that you're using a custom makefile (instead of letting it compile on its own), where it can find the make program, and with what options to execute the make program.
Yea, I know about it and I know, how to set it. I just hoped, that it is possible compile it "normaly".

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 4 guests