Page 1 of 1

Can't Compile Examples??? (Ubuntu 8.04)

Posted: Tue Apr 01, 2008 10:22 pm
by sabaal
Hi there. I'm somewhat new to devkitPro, as well as homebrew in general, and I've been running into some problems compiling the code in the example package I downloaded. I'll use the toon shading demo as an example of the output I'm getting:

Code: Select all

... /examples/Graphics/3D/Misc/Toon_Shading$ make
main.cpp
arm-eabi-g++ -MMD -MP -MF /home/sabaal/Dev/DS/examples/Graphics/3D/Misc/Toon_Shading/build/main.d -g -Wall -O2 -mcpu=arm9tdmi -mtune=arm9tdmi -fomit-frame-pointer -ffast-math -mthumb -mthumb-interwork -I/home/sabaal/Dev/DS/examples/Graphics/3D/Misc/Toon_Shading/include -I/usr/local/devkitPro/libnds/include -I/usr/local/devkitPro/libnds/include -I/home/sabaal/Dev/DS/examples/Graphics/3D/Misc/Toon_Shading/build -DARM9 -fno-rtti -fno-exceptions -c /home/sabaal/Dev/DS/examples/Graphics/3D/Misc/Toon_Shading/source/main.cpp -o main.o
as: unrecognized option `-mcpu=arm9tdmi'
make[1]: *** [main.o] Error 1
make: *** [build] Error 2
Now, I have NO IDEA what this option does, and I can't find anything resembling coherent documentation on the subject. To top it off, I hate makefiles and have therefore learned nothing about them that would be of use to me here. However, a simple text search found the following:

Code: Select all

# note: arm9tdmi isn't the correct CPU arch, but anything newer and LD
# *insists* it has a FPU or VFP, and it won't take no for an answer!
CFLAGS	:=	-g -Wall -O2\
 			-mcpu=arm9tdmi -mtune=arm9tdmi -fomit-frame-pointer\
			-ffast-math \
			$(ARCH)
So... the option that's giving me problems is considered "incorrect" anyway? I have no idea what else I might try here (or what LD, FPU, or VFP are).

I'm using Ubuntu Linux 8.04, but I've had the same problem on earlier releases. I've got several people working on other areas of development, all waiting for me to get the code off the ground, but I can't even compile the example code. Can anyone help me understand and fix this problem, or does anyone know where I can find a manual of some kind for these programs?

Re: Can't Compile Examples??? (Ubuntu 8.04)

Posted: Sat Apr 05, 2008 2:42 pm
by WinterMute
How did you install the toolchain?

The error you're getting suggests that the compiler is using the wrong assembler - the -mcpu option is valid for devkitARM but not actually the correct processor for the DS ARM9. It won't cause major problems now, the comments in the older makefiles were related to versions of devkitARM prior to release 19.

What usually causes something like this is the use of GUI tools for extracting the .tar.bz2 which seem to do odd things with symbolic links. Your other option is to have a go with the experimental linux installer at http://forums.devkitpro.org/viewtopic.php?f=25&t=10

Re: Can't Compile Examples??? (Ubuntu 8.04)

Posted: Sat Apr 05, 2008 10:13 pm
by sabaal
Man, do I feel dumb. :P

As you predicted, I had taken a shortcut during installation and extracted everything using Dolphin's built-in archive browser. After removing these files and re-extracting from command line, everything works perfectly!

You've just crushed a three-month headache of mine into powder in five sentences. You are absolutely, undeniably, adverb-defyingly awesome. Thank you so much! :D

*Adds WinterMute to the Special Thanks list.*