need help for compiling 1st hello wolrd program

support for the ARM toolchain
Post Reply
Koyuki
Posts: 2
Joined: Sun Feb 10, 2013 6:49 pm

need help for compiling 1st hello wolrd program

Post by Koyuki » Sun Feb 10, 2013 7:05 pm

hello

I have problem for compiling the helloworld example that i found in the devkitpro directory
I know how to build (make in terminal or in programmer's notepad).
The makefile seems working fine, but i have compiling errors.

I think maybe i didn't really understand if i correctly installed the ndslib.
Actually, i just ran the complet installer of devkitpro. Maybe should i add somethings in the helloworld folder (but what and where) ?

Since i started today, i think i have all the lastest devkitpro, arm and ndslib.

Thanks anyone for any help.

here is the code and the errors :

Code: Select all

#include <nds.h>
#include <stdio.h>

volatile int frame = 0;

//---------------------------------------------------------------------------------
void Vblank() {
//---------------------------------------------------------------------------------
	frame++;
}
	
//---------------------------------------------------------------------------------
int main(void) {
//---------------------------------------------------------------------------------
	touchPosition touchXY;

	irqSet(IRQ_VBLANK, Vblank);

	consoleDemoInit();

	iprintf("      Hello DS dev'rs\n");
	iprintf("     \x1b[32mwww.devkitpro.org\n");
	iprintf("   \x1b[32;1mwww.drunkencoders.com\x1b[39m");
 
	while(1) {
	
		swiWaitForVBlank();
		touchRead(&touchXY);

		// print at using ansi escape sequence \x1b[line;columnH 
		iprintf("\x1b[10;0HFrame = %d",frame);
		iprintf("\x1b[16;0HTouch x = %04X, %04X\n", touchXY.rawx, touchXY.px);
		iprintf("Touch y = %04X, %04X\n", touchXY.rawy, touchXY.py);		
	
	}

	return 0;
}

Code: Select all

c:/devkitPro/examples/nds/hello_world/source/main.cpp: In function 'int main()':
c:/devkitPro/examples/nds/hello_world/source/main.cpp:38:21: error: 'touchRead' was not declared in this scope
c:/devkitPro/examples/nds/hello_world/source/main.cpp:42:55: error: 'touchPosition' has no member named 'rawx'
c:/devkitPro/examples/nds/hello_world/source/main.cpp:43:45: error: 'touchPosition' has no member named 'rawy'

mtheall
Posts: 210
Joined: Thu Feb 03, 2011 10:47 pm

Re: need help for compiling 1st hello wolrd program

Post by mtheall » Mon Feb 18, 2013 5:24 pm

This code compiles fine for me. Are you using the latest devkitARM and libnds? Can you show the complete make output (and not just the errors)?

Koyuki
Posts: 2
Joined: Sun Feb 10, 2013 6:49 pm

Re: need help for compiling 1st hello wolrd program

Post by Koyuki » Fri Feb 22, 2013 4:10 pm

Hello
Thank your for responding.

Here is the full result of make commande, given by using make in Programmer's Notepad.

> "make"

Code: Select all

main.cpp
arm-none-eabi-g++ -MMD -MP -MF /c/devkitPro/examples/nds/hello_world/build/main.d -g -Wall -O2 -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -mthumb -mthumb-interwork -I/c/devkitPro/examples/nds/hello_world/include -I/c/devkitPro/examples/nds/hello_world/build -I/c/devkitPro/libnds/include -I/c/devkitPro/examples/nds/hello_world/build -DARM9 -fno-rtti -fno-exceptions -c /c/devkitPro/examples/nds/hello_world/source/main.cpp -o main.o 
c:/devkitPro/examples/nds/hello_world/source/main.cpp: In function 'int main()':
c:/devkitPro/examples/nds/hello_world/source/main.cpp:38:21: error: 'touchRead' was not declared in this scope
c:/devkitPro/examples/nds/hello_world/source/main.cpp:42:55: error: 'touchPosition' has no member named 'rawx'
c:/devkitPro/examples/nds/hello_world/source/main.cpp:43:45: error: 'touchPosition' has no member named 'rawy'
make[1]: *** [main.o] Error 1
"make": *** [build] Error 2

> Process Exit Code: 2
> Time Taken: 00:04
I'm actually checking if my versions are really the lastest (for Ndslib and Devkitpro/arm)

robbyke
Posts: 1
Joined: Sat Feb 23, 2013 10:47 pm

Re: need help for compiling 1st hello wolrd program

Post by robbyke » Sat Feb 23, 2013 10:50 pm

I wanted to start toying but have exact same problem as he has

i thought i did something wrong with the integration part of visual studio but it seems thats not the case

this is what visual studio gave me back

Code: Select all

1>------ Build started: Project: hello_world, Configuration: Debug Win32 ------
1>Performing Makefile project actions
1>main.cpp
1>arm-none-eabi-g++ -MMD -MP -MF /c/devkitPro/examples/nds/hello_world/build/main.d -g -Wall -O2 -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -mthumb -mthumb-interwork -I/c/devkitPro/examples/nds/hello_world/include -I/c/devkitPro/examples/nds/hello_world/build -I/c/devkitPro/libnds/include -I/c/devkitPro/examples/nds/hello_world/build -DARM9 -fno-rtti -fno-exceptions -c /c/devkitPro/examples/nds/hello_world/source/main.cpp -o main.o 2>&1 | sed -e 's/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/g'
1>c:/devkitPro/examples/nds/hello_world/source/main.cpp: In function 'int main()':
1>c:/devkitPro/examples/nds/hello_world/source/main.cpp(38):21: error: 'touchRead' was not declared in this scope
1>c:/devkitPro/examples/nds/hello_world/source/main.cpp(42):55: error: 'touchPosition' has no member named 'rawx'
1>c:/devkitPro/examples/nds/hello_world/source/main.cpp(43):45: error: 'touchPosition' has no member named 'rawy'
1>linking hello_world.elf
1>arm-none-eabi-g++.exe: error: main.o: No such file or directory
1>make[1]: *** [/c/devkitPro/examples/nds/hello_world/hello_world.elf] Error 1
1>make: *** [build] Error 2
1>Project : error PRJ0019: A tool returned an error code from "Performing Makefile project actions"
1>Build log was saved at "file://c:\devkitPro\examples\nds\hello_world\Debug\BuildLog.htm"
1>hello_world - 5 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests