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 > Even more problems :-(

#52525 - spencer723 - Wed Aug 31, 2005 3:02 pm

I finally found the Makefile I want to use for creating the .nds.gba and .nds file, but whenever I go to compile it I get these errors:

CreateProcess((null), basename C:/Dev-Cpp, ...) failed.
C:\devkitPro\examples\nds\Graphics\2D\hello_world\Makefile [Build Error] No rule to make target `all'. Stop.

If anyone knows what the problem could be, please reply, thanks.

#52542 - wintermute - Wed Aug 31, 2005 6:03 pm

There are all sorts of reasons why you're having problems. Neither Dev-C++ nor win98 are particularly supported platforms. The vast majority of devkitARM users have at least win2k and the installer reflects this.

The toolchain as a whole has been carefully crafted to work transparently on windows, linux and OS X provided that the environment variables are set correctly. The make provided with dev-c++ is *not* suitable for this.

You can set up the environment variables in win98 using the instructions found here http://www.chem.gla.ac.uk/~louis/software/faq/q1.html#win98

Note: the DEVKITARM and DEVKITPRO variables need to be in unix format ( /<drive lettter>/path/to )

You also need to set the path for msys, look for a set PATH= line in msconfig and add c:\devkitPro\msys\bin; to the start of that variable, assuming you installed to the default c:\devkitPro. You can also just insert set PATH=c:\devkitPro\msys\bin;%PATH% at the bottom.

You will need to reboot after making these changes.

As for the no rule to make target `all' error.

in the Makefile look for these lines

Code:

.PHONY: $(BUILD) clean
 
#---------------------------------------------------------------------------------
$(BUILD):


edit so it appears like this

Code:

.PHONY: $(BUILD) clean all

#---------------------------------------------------------------------------------
all: $(BUILD)

$(BUILD):

#52553 - spencer723 - Wed Aug 31, 2005 7:24 pm

Thank you very much :-D

I'm still having a bit of problems with it though, I changed the variable back to "/c/..." but now it's saying there's no such file ot directory, when it's the other way (C:\) it works fine.

#52557 - wintermute - Wed Aug 31, 2005 8:43 pm

you need to run msys make, not any other make that may be found on your system. It may work with the full path in your dev-cpp setup but you do need to have the msys bin directory in your path.

#52577 - spencer723 - Thu Sep 01, 2005 1:51 am

Thank you so much! Wow you're good with this stuff.

One more problem though...when it goes to compile it, it says there's something wrong with the 'CIDLoop' in arm9_crt0.o, it says theres an unidentified reference to 'main'

#52627 - wintermute - Thu Sep 01, 2005 1:56 pm

For some reason it's not picking up the source files in the project. Are you attempting to build one of the examples using dev-cpp or are you trying to modify something?

#52637 - spencer723 - Thu Sep 01, 2005 4:25 pm

I'm trying to compile one of the examples that came with devkitPro, I'm using Msys by typing "make" when I'm in the directory with the code and Makefile, it prints this on the screen:

linking NDSCOD~1.elf
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-elf/4.0.1/../../../../arm-elf/lib/thumb/interwork/ds_arm9_crt0.o: In function `CIDLoop':
ds_arm9_crt0.s:(.init+0x200): undefined reference to `main'
make[1]: *** [/c/NDSCOD~1/NDSCOD~1.elf] Error 1
make: *** [build] Error 2

NOTE: The directory my code is in is C:\NDS Code Test

#52648 - wintermute - Thu Sep 01, 2005 5:24 pm

Remove the spaces from the directory name. All should work after that.

#52670 - spencer723 - Thu Sep 01, 2005 7:28 pm

I removed the spaces and changed the name of my folder to "NDS" and I still get the same error, does it have something to do with the ds_arm9_crt0.s file?

Also, I'm getting a "build" folder and inside the folder there is a file named NDS.map.

#52699 - Ethos - Fri Sep 02, 2005 2:59 am

you have no main function
_________________
Ethos' Homepage (Demos/NDS 3D Tutorial)

#52702 - spencer723 - Fri Sep 02, 2005 3:13 am

I have one file named 'main.cpp' and my main function starts like this:

Code:

int main(int argc, char **argv) {
code goes here...
}

#52704 - tepples - Fri Sep 02, 2005 3:18 am

Are you actually using the features of C++ that aren't in C? If not, try renaming 'main.cpp' to 'main.c'. Is the linker using gcc or g++?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#52726 - Ethos - Fri Sep 02, 2005 1:01 pm

Also make sure the file holding your main function is being compiled, and if that is so it must not be linked....look at your Makefile!!!
_________________
Ethos' Homepage (Demos/NDS 3D Tutorial)

#52728 - spencer723 - Fri Sep 02, 2005 1:30 pm

Okay, I decided to scrap what I was doing before and was looking at tutorials from http://www.double.co.nz/nintendo_ds/nds_develop1.html. Whenever I go to make it, I get this:

$ make
arm-elf-g++ -g -Wall -O2 -mcpu=arm7tdmi -mtune=arm7tdmi -fomit-frame-pointer -ffast-math -mthumb-interwork -I/c/devkitPro/libnds/include -DARM7 -c arm7_main.cpp -oarm7_main.o
arm-elf-g++.exe: no input files
make: *** [arm7_main.o] Error 1

I have "arm-elf-g++.exe" in the bin folder for msys.


Last edited by spencer723 on Fri Sep 02, 2005 1:32 pm; edited 1 time in total

#52729 - wintermute - Fri Sep 02, 2005 1:32 pm

The example makefiles read source code from the source folder

Project Folder
|
+include (header files go here)
|
+source (c/cpp files go here)
|
Makefile

#52730 - spencer723 - Fri Sep 02, 2005 1:35 pm

Could I get an example of that? I don't understand how I would write that into the Makefile. Thanks.

#52743 - wintermute - Fri Sep 02, 2005 5:57 pm

You don't need to write it in the makefile.

The example makefiles automatically pick up all c/c++ files found in the source directory. Have a look at the template, it includes a main.c, note where it's placed.

#52745 - spencer723 - Fri Sep 02, 2005 6:25 pm

What would the source directory be? This is the Makefile I am using right now with the example I downloaded:

Code:

NDSLIB_INCLUDE=$(DEVKITPRO)/libnds/include
NDSLIB_LIB=$(DEVKITPRO)/libnds/lib

all: demo1.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

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

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

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

demo1.nds.gba: demo1.nds
   dsbuild demo1.nds -o demo1.nds.gba

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


I have 2 files in the folder called "arm9_main.cpp" and "arm7_main.cpp" in the folder "C:\demo1"

#52760 - Dannon - Fri Sep 02, 2005 8:38 pm

I have a small template setup that I have put together you can try using this, it should compile aslong as you have NDSLIBPATH and DEVKITARM setup in enviroment variables and have the /bin directory of msys and devkitARM setup in the 'Path' system variable, hope this helps (hope this works!)

You can get the template Here

#52764 - wintermute - Fri Sep 02, 2005 10:32 pm

spencer723 wrote:
What would the source directory be? This is the Makefile I am using right now with the example I downloaded:



When you installed devkitPro, a set of examples were placed in <drive>:\devkitPro\examples\nds

Inside the templates directory there you will find two templates, one is for a dual core application for custom arm7 code. One is an arm9 only project using the default arm7 core provided with ndstool.

Within the other directories you will find numerous examples which illustrate various aspects of libnds.

These examples work, unfortunately any other examples you find cannot be guaranteed to work with the current or any future iteration of the toolchain.

#52766 - wintermute - Fri Sep 02, 2005 10:33 pm

Dannon wrote:
I have a small template setup that I have put together you can try using this, it should compile aslong as you have NDSLIBPATH and DEVKITARM setup in enviroment variables and have the /bin directory of msys and devkitARM setup in the 'Path' system variable, hope this helps (hope this works!)

You can get the template Here


ndslib is deprecated and will no longer be updated. All work has now moved to libnds.

#52773 - spencer723 - Fri Sep 02, 2005 11:07 pm

Alright I found the Makefile and organized the folders like the example, it's finding the folders and everything, but now it's not finding 'nds.h'. I checked the Makefiles and all it says for including is "INCLUDES := include build" in arm7's Makefile and "INCLUDES := include" in the arm9 Makefile. And I just wanna thank all the people who are helping me with this.

#52775 - wintermute - Fri Sep 02, 2005 11:16 pm

In the makefile you'll find a section like this

Code:

CFLAGS   :=   -g -Wall -O2\
          -mcpu=arm9tdmi -mtune=arm9tdmi -fomit-frame-pointer\
         -ffast-math \
         $(ARCH)

CFLAGS   +=   $(INCLUDE) -DARM9


add this just after that

Code:

CXXFLAGS   := $(CFLAGS)


this has been updated in CVS recently and will be in the next update

#52781 - spencer723 - Sat Sep 03, 2005 12:23 am

It worked! Thank you so much wintermute! I might just have to put you into my credits when I get to my game :-D.