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 > About the make command?

#47367 - @11000RPM - Fri Jul 08, 2005 5:12 am

Hi everyone, I am new, I have read Chris tutorial

http://www.double.co.nz/nintendo_ds/nds_develop1.html , it is great!

but I now stuck in part one. My problem is when I used the make command in the console, it outputs

"arm-elf-g++ -g -Wall -02 -mcpu=arm7tdmi -mtune=arm7tdmi -fomit-frame-pointer -ffast-math -mthumb-interwork -I/c/devkitpro/libnds/include -DARM7 -c arm7_main.cpp -oarm7_main.o"

"arm7_main.cpp:6:17: nds.h: No such file or directory"

error ....
...
..

I already extracted the libnds and put it in c:\devkitpro\libnds
and i also set up the variable for DEVKITPRO=/c/devkitpro
from the makefile
NDSLIB_INCLUDE=$(DEVKITPRO)/libnds/include

and I can find the nds.h in the c:\devkitpro\libnds\include

does anyone knows whats the problem with it, Thank you

#47368 - doublec - Fri Jul 08, 2005 5:19 am

Are you running 'make' from a DOS Command window or from a bash shell? It should be a DOS command window.

Also are you sure you are using 'libnds' and not 'ndslib'? Is there an 'nds.h' inside the include directory?

#47369 - @11000RPM - Fri Jul 08, 2005 5:51 am

Thanks for your reply
Yes I use the command make in DOS console window

and I am not quite sure the difference between 'libnds' and 'ndslib', but
i have a dir c:\devkitpro\libnds, inside it i have dir include and lib and a file license.txt, inside dir include, i have dir nds and a header file nds.h,
so my nds.h file is in c:\devkitpro\libnds\include

I already set up the variable for DEVKITPRO=/c/devkitpro

and i found that from the makefile, there is a line
NDSLIB_INCLUDE=$(DEVKITPRO)/libnds/include

so everything is alright (I think), dont know why it cannot find the nds.h file
[/img]

#47390 - Spaceface - Fri Jul 08, 2005 2:46 pm

I've had simialar problems when I set the vars DEVKITPRO etc while my cmd.exe window was open.. it only reads them when opened and stores 'em. Same goes for the tool total commander.. for some reason total commander reads the vars and when you open cmd.exe within total commander you're screwed too.. but you've probably tried all those things or rebooting.. but in case you didn't, do so :)

#47410 - @11000RPM - Fri Jul 08, 2005 5:07 pm

Yeah i have tried that but still cannot make it work, thanks anyway,
i also tried different computers, and finally i can make it work under Linux environment, so strange. I have to use Linux now, but seems cannot use Wifime under Linux.

#47412 - FourScience - Fri Jul 08, 2005 5:21 pm

As Spaceface said, make sure you restart cmd.exe after you set the environment variables for them to take effect.

The only other thing that might be amiss is in the arm7_main.cpp file itself. Check the #include line, it should read:
Code:
#include <nds.h>


If that is set, then all the pieces of the puzzle should be in place. Judging from your error output, "arm7_main.cpp:6:17: nds.h: No such file or directory", that looks like the correct amount of characters for that line.

The only other thing is maybe the paths are case sensitive. Is your devkitPRO install directory C:\devkitPRO or C:\devkitpro?
_________________
Work in progress: Dual-Soft.com

#47413 - FourScience - Fri Jul 08, 2005 5:24 pm

@11000RPM wrote:
Yeah i have tried that but still cannot make it work, thanks anyway,
i also tried different computers, and finally i can make it work under Linux environment, so strange. I have to use Linux now, but seems cannot use Wifime under Linux.


Also, did you install MinSys (msys), or cygwin? Your make command calls just fine but maybe it's not liking the /c/... style path definition.
_________________
Work in progress: Dual-Soft.com

#47416 - GPFerror - Fri Jul 08, 2005 5:39 pm

Here is my Makefile thats based on Chris' tutorial example.

I am using mingw to run make, and its working for me.

Hopefully this helps.

Troy

Code:
# Makefile for YASFcave.nds
# troy_ed@yahoo.com
NDSLIB_INCLUDE=$(DEVKITPRO)/libnds/include
NDSLIB_LIB=$(DEVKITPRO)/libnds/lib

all: YASFcave.nds.gba

arm7_main.o: arm7_main.cpp
   arm-elf-g++ -g -Wall -O2 -mcpu=arm7tdmi -mtune=arm7tdmi -fomit-frame-pointer -ffast-math -mthumb-interwork -I$(NDSLIB_INCLUDE) -DARM7 -c arm7_main.cpp -oarm7_main.o

arm7.elf: arm7_main.o
   arm-elf-g++ -g -mthumb-interwork -mno-fpu -specs=ds_arm7.specs arm7_main.o -L$(NDSLIB_LIB) -lnds7 -oarm7.elf

arm7.bin: arm7.elf
   arm-elf-objcopy -O binary arm7.elf arm7.bin

arm9_main.o: arm9_main.cpp
   arm-elf-g++ -g -Wall -O2 -mcpu=arm9tdmi -mtune=arm9tdmi -fomit-frame-pointer -ffast-math -mthumb-interwork -I$(NDSLIB_INCLUDE) -DARM9 -c arm9_main.cpp -oarm9_main.o

Game.o: Game.cpp
   arm-elf-g++ -g -Wall -O2 -mcpu=arm9tdmi -mtune=arm9tdmi -fomit-frame-pointer -ffast-math -mthumb-interwork -I$(NDSLIB_INCLUDE) -DARM9 -c Game.cpp -oGame.o

Map.o: Map.cpp
   arm-elf-g++ -g -Wall -O2 -mcpu=arm9tdmi -mtune=arm9tdmi -fomit-frame-pointer -ffast-math -mthumb-interwork -I$(NDSLIB_INCLUDE) -DARM9 -c Map.cpp -oMap.o

arm9.elf: arm9_main.o Game.o Map.o
   arm-elf-g++ -g -mthumb-interwork -mno-fpu -specs=ds_arm9.specs arm9_main.o Game.o Map.o -L$(NDSLIB_LIB) -lnds9 -o arm9.elf

arm9.bin: arm9.elf
   arm-elf-objcopy -O binary arm9.elf arm9.bin

YASFcave.nds: arm7.bin arm9.bin
   ndstool -c YASFcave.nds -9 arm9.bin -7 arm7.bin

YASFcave.nds.gba: YASFcave.nds
   dsbuild YASFcave.nds -o YASFcave.nds.gba

clean:
   rm -f *.bin
   rm -f *.elf
   rm -f *.o
   rm -f *~

#47472 - @11000RPM - Sat Jul 09, 2005 9:00 am

Thanks everyone, I have tried to reboot the machine or restart the cmd.exe,
the #include<nds.h> line is also fine, I have checked the case of the dir name, I have installed msys, I suspect msys causes the problem, but as long as i can use Unix command in DOS, so seems it is not the problem, I have installed mingw but the result still the same.

i will keep using Linux for this, thanks for everyone who given me suggestions.

#47513 - corsec - Sun Jul 10, 2005 3:18 am

Here is a makefile that you should try:
I changed Chris' Makefile so that all of the executable names are at the top, and easily changed. Also, I have an NDSLIBPATH instead of refering to the devkit directory.

Code:
# Makefile for demo1.nds
# chris.double@double.co.nz
# modified by Anders Hustvedt
NDSLIB_INCLUDE=$(NDSLIBPATH)/include
NDSLIB_LIB=$(NDSLIBPATH)/lib

ARM7 = arm7_main
ARM9 = arm9_main
OUT =  demo1

all: $(OUT).nds.gba

$(ARM7).o: $(ARM7).cpp
   arm-elf-g++ -g -Wall -O2 -mcpu=arm7tdmi -mtune=arm7tdmi -fomit-frame-pointer -ffast-math -mthumb-interwork -I$(NDSLIB_INCLUDE) -DARM7 -c $^ -o$@

$(ARM7).elf: $(ARM7).o
   arm-elf-g++ -g -mthumb-interwork -mno-fpu -specs=ds_arm7.specs $^ -L$(NDSLIB_LIB) -lnds7 -o$@

$(ARM7).bin: $(ARM7).elf
   arm-elf-objcopy -O binary $^ $@

$(ARM9).o: $(ARM9).cpp
   arm-elf-g++ -g -Wall -O2 -mcpu=arm9tdmi -mtune=arm9tdmi -fomit-frame-pointer -ffast-math -mthumb-interwork -I$(NDSLIB_INCLUDE) -DARM9 -c $^ -o$@

$(ARM9).elf: $(ARM9).o
   arm-elf-g++ -g -mthumb-interwork -mno-fpu -specs=ds_arm9.specs $^ -L$(NDSLIB_LIB) -lnds9 -o $@

$(ARM9).bin: $(ARM9).elf
   arm-elf-objcopy -O binary $^ $@

$(OUT).nds: $(ARM7).bin $(ARM9).bin
   ndstool -c $@ -9 $(ARM9).bin -7 $(ARM7).bin

$(OUT).nds.gba: $(OUT).nds
   dsbuild $^ -o $@

clean:
   rm -f *.bin
   rm -f *.elf
   rm -f *.o
   rm -f *~
   rm *.nds
   rm *.gba

_________________
Currently working on a flight simulator set in 1916.
http://ucsub.colorado.edu/~hustvedt/ds.html

#47596 - Volta - Mon Jul 11, 2005 5:28 am

I'm a new comer to the ds scene too, coming from GBA.

The environment installation is waay to complex at this moment. I followed the manual install of devkitpro and aaronrogers and they are almost contradicting each other one some points regarding the path variables.

1- I'm on Windows XP.
2- I want to program, not installing the nds env. for hours.
3- I'm not an expert asm coder and playing with each bit of the registry is not my cup of tea.
4- I want to program a game, not a technical demo featuring the 4th vram bank.

I can't wait for the 3rd version of the nds dev env of aaronrogers...

#47634 - FourScience - Mon Jul 11, 2005 4:34 pm

Volta wrote:
I'm a new comer to the ds scene too, coming from GBA.

The environment installation is waay to complex at this moment. I followed the manual install of devkitpro and aaronrogers and they are almost contradicting each other one some points regarding the path variables.

1- I'm on Windows XP.
2- I want to program, not installing the nds env. for hours.
3- I'm not an expert asm coder and playing with each bit of the registry is not my cup of tea.
4- I want to program a game, not a technical demo featuring the 4th vram bank.

I can't wait for the 3rd version of the nds dev env of aaronrogers...


I wouldn't wait for arog to get the 3rd version out. I support his work but it's really not that hard to get the dev env setup manually.

I just tried a complete manual install of devkitARM r13, MSys, and libnds, and it took less than 30 minutes. I wasn't rushed about it and I even made a couple small mistakes. I went directly to devkit.tk and I was able to figure everything out from there, including how to get MSys despite the broken link (get it here), and applying the base_rules and linkscripts bug fixes.

I didn't need to bother with CVS, though I could have and I know how to use it. I just needed to add two PATH variable values (msys/bin and devkitARM/bin), and variables for DEVKITPRO and DEVKITARM.

I have seen installs get borked before though and it isn't really easy to track down what's wrong. Still, it's not that hard to at least give it a shot, because typically it can be setup in well under an hour.
_________________
Work in progress: Dual-Soft.com