Page 1 of 1
Code::Blocks?
Posted: Fri Apr 24, 2009 1:20 am
by Dr. Kylstein
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.
Re: Code::Blocks?
Posted: Fri Apr 24, 2009 3:39 am
by weirdfox
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.
Re: Code::Blocks?
Posted: Fri Apr 24, 2009 4:07 am
by Dr. Kylstein
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?
Re: Code::Blocks?
Posted: Fri Apr 24, 2009 4:51 am
by weirdfox
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
Re: Code::Blocks?
Posted: Sat Apr 25, 2009 12:37 am
by Dr. Kylstein
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.
Re: Code::Blocks?
Posted: Sat Apr 25, 2009 3:19 pm
by weirdfox
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
Re: Code::Blocks?
Posted: Sun Sep 27, 2009 8:39 am
by Laethnes
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.
Re: Code::Blocks?
Posted: Sun Sep 27, 2009 1:21 pm
by vuurrobin
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.
Re: Code::Blocks?
Posted: Sun Sep 27, 2009 3:03 pm
by Laethnes
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".