#104058 - JesterDev - Tue Sep 26, 2006 7:45 am
I'm using http://www.dsprogramming101.com/ tutorials, and I cannot get my code to compile but the Hello world example from the site compiles just fine..
Not sure what I'm doing wrong..
My code:
The the error I'm getting:
linking Work.elf
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.1/../../../../arm-eabi/lib/th
umb/ds_arm9_crt0.o: In function `CIDLoop':
ds_arm9_crt0.s:(.init+0x218): undefined reference to `main'
collect2: ld returned 1 exit status
make[1]: *** [/c/devkitPro/Work/Work.elf] Error 1
make: *** [build] Error 2
Any ideas? I've compared my code with the downloaded example, and as far as I can see they are both the same (save for comments).
Not sure what I'm doing wrong..
My code:
Code: |
// Hello World For the Nintendo DS // Inlcudes #include <nds.h> #include <nds/arm9/console.h> // basic print functionality #include <stdio.h> int main(void) { videoSetMode(0); // not using the main (touch) screen videoSetModeSub(MODE_0_2D | DISPLAY_BG0_ACTIVE); // sub bg 0 will be used to print text vramSetBankC(VRAM_C_SUB_BG); SUB_BG0_CR = BG_MAP_BASE(31); BG_PALETTE_SUB[255] = RGB15(31,31,31); // BG Black / Text White // consoleInit() is alot more flexible and gets us up and working quickly consoleInitDefault((u16*)SCREEN_BASE_BLOCK_SUB(31), (u16*)SCREEN_BASE_BLOCK_SUB(0), 16); iprintf("Hello World!"); while(1) { swiWaitForVBlank(); // wait for the next screen refresh } // end of while loop return 0; } // end main |
The the error I'm getting:
linking Work.elf
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.1/../../../../arm-eabi/lib/th
umb/ds_arm9_crt0.o: In function `CIDLoop':
ds_arm9_crt0.s:(.init+0x218): undefined reference to `main'
collect2: ld returned 1 exit status
make[1]: *** [/c/devkitPro/Work/Work.elf] Error 1
make: *** [build] Error 2
Any ideas? I've compared my code with the downloaded example, and as far as I can see they are both the same (save for comments).