gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Dev-C++

#167848 - Johnny(TM) - Tue Mar 31, 2009 1:28 pm

I'm trying to set up devkitPro, so I can compile codes in Dev-C++ for DS. I have installed everything, also used the help of the manual. In the project options, I added to the linker the following lines:
-lmm9
-lnds9

Set up the lib directory:
C:\_DS_\devkitPro\libnds\lib

And the include directories:
C:\_DS_\devkitPro\libnds\include
C:\_DS_\devkitPro\devkitARM\arm-eabi\include

Finally, here's the code:
Code:
#define ARM9
#include <nds.h>
 
int main()
{
    swiWaitForVBlank();
}


And the error the compiler returned was quite surprising:
skipping incompatible C:/_DS_/devkitPro/libnds/lib/libmm9.a when searching for -lmm9

If I remove the files from linker, here's the result:
[Linker error] undefined reference to `swiWaitForVBlank'
[Linker error] undefined reference to `glGlobalData'

I'm pretty sure the problem is in the linker, did anyone else tried to set up this in devcpp?

#167849 - bean_xp - Tue Mar 31, 2009 1:31 pm

Are you compiling with the gcc/g++ that comes with Dev-C++ instead of the compilers with devkitarm?

There should be an option to use a makefile for the project in Dev-C++, if you supply it with one of the makefiles in the samples it should work.

#167850 - Johnny(TM) - Tue Mar 31, 2009 5:18 pm

bean_xp wrote:
Are you compiling with the gcc/g++ that comes with Dev-C++ instead of the compilers with devkitarm?

There should be an option to use a makefile for the project in Dev-C++, if you supply it with one of the makefiles in the samples it should work.

That could be the problem. Dev-Cpp used his default compiler. I added the makefile as you mentioned, now it gave me the following error:
*** "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM". Stop.

I'm pretty sure the project is fine now, I just need to modify something in the Dev-Cpp settings, but I can't find it.

#167862 - bean_xp - Wed Apr 01, 2009 2:58 am

If you check out this URL. I think setting the environment variables, as described on the page should solve your problems.

#168067 - silent_code - Wed Apr 08, 2009 11:20 pm

Before I cahnged to COde::Bocks, I used Dev-C++ for all my C/C++ programming. It's easy to set up and it works.

Regards.
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.