PDA

View Full Version : SDL 1.2.9 for the DS



GPF
March 6th, 2006, 20:21
OK finally uploaded the newer version of SDL 1.2.9, SDL_image1.2.6 and SDL_mixer-1.2.6 , the precompiled libs and examples have not been updated with the new version yet though. Thanks to parrot from #dsdev for the help upgrading SDL.

Troy(GPF)
http://gpf.dcemu.co.uk/ndsSDL.shtml

LTK
March 8th, 2006, 00:13
Very very nice news!! Let's try

LTK
March 8th, 2006, 17:01
I've got this error when I try to complie anything with new SDL version (1.2.9) old version 1.2.3 compiles well. Also I've tried to complie SDL 1.2.9 sources and the path c:/devkitPro/msys/home/Troy.Davis/prj/SDL/source/joystick/nds/SDL_sysjoystick.c:48: changes to dir where SDL source is allocated.



ltk@debian:~/NDSSDLexamples1.2.9/fireSDL$ make
linking fireSDL.elf
/opt/devkitPRO/devkitARM/bin/../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/lib/interwork/libg.a(signalr.o): In function `_kill_r':
: warning:
/opt/devkitPRO/libnds/lib/libSDL.a(SDL_sysjoystick.o): In function `SDL_SYS_JoystickInit':
c:/devkitPro/msys/home/Troy.Davis/prj/SDL/source/joystick/nds/SDL_sysjoystick.c:48: undefined reference to `keysInit'
collect2: ld returned 1 exit status
make[1]: *** [/home/ltk/NDSSDLexamples1.2.9/fireSDL/fireSDL.elf] Error 1
make: *** [build] Error 2


I use devkitARM r17 and libnds-20060201

GPF
March 8th, 2006, 17:24
look like your still using the old libSDL.a . keysInit() was removed from newer version of libnds. New version of SDL 1.2.9 doesnt have that command anymore, so im guessing your linking the old lib.

Troy(GPF)

LTK
March 8th, 2006, 18:36
Many thanks, I´m gonna to install all the again.

LTK
March 9th, 2006, 00:43
I've been able to compile all libs except SDL_image, here is the error



In file included from SDL_image-1.2.4/source/IMG_bmp.c:30:
SDL_image-1.2.4/source/SDL_image.h:59: error: syntax error before 'IMG_Linked_Version'
SDL_image-1.2.4/source/SDL_image.h:59: warning: type defaults to 'int' in declaration of 'IMG_Linked_Version'
SDL_image-1.2.4/source/SDL_image.h:59: warning: data definition has no type or storage class
SDL_image-1.2.4/source/SDL_image.h:69: error: syntax error before 'IMG_LoadTyped_RW'
SDL_image-1.2.4/source/SDL_image.h:69: warning: type defaults to 'int' in declaration of 'IMG_LoadTyped_RW'
SDL_image-1.2.4/source/SDL_image.h:69: warning: data definition has no type or storage class
SDL_image-1.2.4/source/SDL_image.h:71: error: syntax error before 'IMG_Load'
SDL_image-1.2.4/source/SDL_image.h:71: warning: type defaults to 'int' in declaration of 'IMG_Load'
SDL_image-1.2.4/source/SDL_image.h:71: warning: data definition has no type or storage class
SDL_image-1.2.4/source/SDL_image.h:72: error: syntax error before 'IMG_Load_RW'
SDL_image-1.2.4/source/SDL_image.h:72: warning: type defaults to 'int' in declaration of 'IMG_Load_RW'
SDL_image-1.2.4/source/SDL_image.h:72: warning: data definition has no type or storage class
SDL_image-1.2.4/source/SDL_image.h:77: error: syntax error before 'IMG_InvertAlpha'
SDL_image-1.2.4/source/SDL_image.h:77: warning: type defaults to 'int' in declaration of 'IMG_InvertAlpha'
SDL_image-1.2.4/source/SDL_image.h:77: warning: data definition has no type or storage class
SDL_image-1.2.4/source/SDL_image.h:80: error: syntax error before 'IMG_isBMP'
SDL_image-1.2.4/source/SDL_image.h:80: warning: type defaults to 'int' in declaration of 'IMG_isBMP'
SDL_image-1.2.4/source/SDL_image.h:80: warning: data definition has no type or storage class
SDL_image-1.2.4/source/SDL_image.h:81: error: syntax error before 'IMG_isPNM'
SDL_image-1.2.4/source/SDL_image.h:81: warning: type defaults to 'int' in declaration of 'IMG_isPNM'
SDL_image-1.2.4/source/SDL_image.h:81: warning: data definition has no type or storage class
SDL_image-1.2.4/source/SDL_image.h:82: error: syntax error before 'IMG_isXPM'
SDL_image-1.2.4/source/SDL_image.h:82: warning: type defaults to 'int' in declaration of 'IMG_isXPM'
SDL_image-1.2.4/source/SDL_image.h:82: warning: data definition has no type or storage class
SDL_image-1.2.4/source/SDL_image.h:83: error: syntax error before 'IMG_isXCF'
SDL_image-1.2.4/source/SDL_image.h:83: warning: type defaults to 'int' in declaration of 'IMG_isXCF'
SDL_image-1.2.4/source/SDL_image.h:83: warning: data definition has no type or storage class
SDL_image-1.2.4/source/SDL_image.h:84: error: syntax error before 'IMG_isPCX'
SDL_image-1.2.4/source/SDL_image.h:84: warning: type defaults to 'int' in declaration of 'IMG_isPCX'
SDL_image-1.2.4/source/SDL_image.h:84: warning: data definition has no type or storage class
SDL_image-1.2.4/source/SDL_image.h:85: error: syntax error before 'IMG_isGIF'
SDL_image-1.2.4/source/SDL_image.h:85: warning: type defaults to 'int' in declaration of 'IMG_isGIF'
SDL_image-1.2.4/source/SDL_image.h:85: warning: data definition has no type or storage class
SDL_image-1.2.4/source/SDL_image.h:86: error: syntax error before 'IMG_isJPG'
SDL_image-1.2.4/source/SDL_image.h:86: warning: type defaults to 'int' in declaration of 'IMG_isJPG'
SDL_image-1.2.4/source/SDL_image.h:86: warning: data definition has no type or storage class
SDL_image-1.2.4/source/SDL_image.h:87: error: syntax error before 'IMG_isTIF'
SDL_image-1.2.4/source/SDL_image.h:87: warning: type defaults to 'int' in declaration of 'IMG_isTIF'
SDL_image-1.2.4/source/SDL_image.h:87: warning: data definition has no type or storage class
SDL_image-1.2.4/source/SDL_image.h:88: error: syntax error before 'IMG_isPNG'
SDL_image-1.2.4/source/SDL_image.h:88: warning: type defaults to 'int' in declaration of 'IMG_isPNG'
SDL_image-1.2.4/source/SDL_image.h:88: warning: data definition has no type or storage class
SDL_image-1.2.4/source/SDL_image.h:89: error: syntax error before 'IMG_isLBM'
SDL_image-1.2.4/source/SDL_image.h:89: warning: type defaults to 'int' in declaration of 'IMG_isLBM'
SDL_image-1.2.4/source/SDL_image.h:89: warning: data definition has no type or storage class
SDL_image-1.2.4/source/SDL_image.h:92: error: syntax error before 'IMG_LoadBMP_RW'
SDL_image-1.2.4/source/SDL_image.h:92: warning: type defaults to 'int' in declaration of 'IMG_LoadBMP_RW'
SDL_image-1.2.4/source/SDL_image.h:92: warning: data definition has no type or storage class
SDL_image-1.2.4/source/SDL_image.h:93: error: syntax error before 'IMG_LoadPNM_RW'
SDL_image-1.2.4/source/SDL_image.h:93: warning: type defaults to 'int' in declaration of 'IMG_LoadPNM_RW'
SDL_image-1.2.4/source/SDL_image.h:93: warning: data definition has no type or storage class
SDL_image-1.2.4/source/SDL_image.h:94: error: syntax error before 'IMG_LoadXPM_RW'
SDL_image-1.2.4/source/SDL_image.h:94: warning: type defaults to 'int' in declaration of 'IMG_LoadXPM_RW'
SDL_image-1.2.4/source/SDL_image.h:94: warning: data definition has no type or storage class
SDL_image-1.2.4/source/SDL_image.h:95: error: syntax error before 'IMG_LoadXCF_RW'
SDL_image-1.2.4/source/SDL_image.h:95: warning: type defaults to 'int' in declaration of 'IMG_LoadXCF_RW'
SDL_image-1.2.4/source/SDL_image.h:95: warning: data definition has no type or storage class
SDL_image-1.2.4/source/SDL_image.h:96: error: syntax error before 'IMG_LoadPCX_RW'
SDL_image-1.2.4/source/SDL_image.h:96: warning: type defaults to 'int' in declaration of 'IMG_LoadPCX_RW'
SDL_image-1.2.4/source/SDL_image.h:96: warning: data definition has no type or storage class
SDL_image-1.2.4/source/SDL_image.h:97: error: syntax error before 'IMG_LoadGIF_RW'
SDL_image-1.2.4/source/SDL_image.h:97: warning: type defaults to 'int' in declaration of 'IMG_LoadGIF_RW'
SDL_image-1.2.4/source/SDL_image.h:97: warning: data definition has no type or storage class
SDL_image-1.2.4/source/SDL_image.h:98: error: syntax error before 'IMG_LoadJPG_RW'
SDL_image-1.2.4/source/SDL_image.h:98: warning: type defaults to 'int' in declaration of 'IMG_LoadJPG_RW'
SDL_image-1.2.4/source/SDL_image.h:98: warning: data definition has no type or storage class
SDL_image-1.2.4/source/SDL_image.h:99: error: syntax error before 'IMG_LoadTIF_RW'
SDL_image-1.2.4/source/SDL_image.h:99: warning: type defaults to 'int' in declaration of 'IMG_LoadTIF_RW'
SDL_image-1.2.4/source/SDL_image.h:99: warning: data definition has no type or storage class
SDL_image-1.2.4/source/SDL_image.h:100: error: syntax error before 'IMG_LoadPNG_RW'
SDL_image-1.2.4/source/SDL_image.h:100: warning: type defaults to 'int' in declaration of 'IMG_LoadPNG_RW'
SDL_image-1.2.4/source/SDL_image.h:100: warning: data definition has no type or storage class
SDL_image-1.2.4/source/SDL_image.h:101: error: syntax error before 'IMG_LoadTGA_RW'
SDL_image-1.2.4/source/SDL_image.h:101: warning: type defaults to 'int' in declaration of 'IMG_LoadTGA_RW'
SDL_image-1.2.4/source/SDL_image.h:101: warning: data definition has no type or storage class
SDL_image-1.2.4/source/SDL_image.h:102: error: syntax error before 'IMG_LoadLBM_RW'
SDL_image-1.2.4/source/SDL_image.h:102: warning: type defaults to 'int' in declaration of 'IMG_LoadLBM_RW'
SDL_image-1.2.4/source/SDL_image.h:102: warning: data definition has no type or storage class
SDL_image-1.2.4/source/SDL_image.h:104: error: syntax error before 'IMG_ReadXPMFromArray'
SDL_image-1.2.4/source/SDL_image.h:104: warning: type defaults to 'int' in declaration of 'IMG_ReadXPMFromArray'
SDL_image-1.2.4/source/SDL_image.h:104: warning: data definition has no type or storage class
SDL_image-1.2.4/source/IMG_bmp.c:428: error: conflicting types for 'IMG_LoadBMP_RW'
SDL_image-1.2.4/source/SDL_image.h:92: error: previous declaration of 'IMG_LoadBMP_RW' was here
make[1]: *** [IMG_bmp.o] Error 1


.... and so on

GPF
March 9th, 2006, 01:04
add to the top


#ifdef __NDS__
#include <nds.h>
#define DECLSPEC
#define SDLCALL
#endif


and then define -D__NDS__ in your makefile

very strange,
#include "begin_code.h"
at the top of that file should have done that automatically, it works on my machines for some reason. Ill have to look into this some more later.

Troy(GPF)

LTK
March 9th, 2006, 08:28
Many thanks again, I added



#ifdef __NDS__
#include
#define DECLSPEC
#define SDLCALL
#endif


to "begin_code.h" and that compiled ok.

GPF
March 9th, 2006, 17:03
Many thanks again, I added



#ifdef __NDS__
#include
#define DECLSPEC
#define SDLCALL
#endif


to "begin_code.h" and that compiled ok.

are you using dos/cmd window or msys? Just curious if thats related to why it didnt work for you originally.

Morpheo17
April 8th, 2006, 16:05
Hello!!!

I've got this error when I try to complie libpng from SDL 1.2.9.
Can u help me with this??


C:\Proyectos\NDS\SDL\libpng-1.2.8>make
arm-elf-gcc -o pngtest pngtest.o -mthumb -mthumb-interwork -L. -L../zlib-1.2.2 -lpng -lz -lm -s c:\proyectos\nds\devkitpro\devkitarm\bin\..\lib\gc c\arm-elf\4.0.2\..\..\..\..\ar
m-elf\bin\ld.exe: crt0.o: No such file: No such file or directory
make: *** [pngtest] Error 1

I have been able to compile: SDL 1.2.9 and zlib, only xDDD. I am very bad compiling things ^^

Thanks :D

GPF
April 8th, 2006, 22:22
Hello!!!

I've got this error when I try to complie libpng from SDL 1.2.9.
Can u help me with this??


C:\Proyectos\NDS\SDL\libpng-1.2.8>make
arm-elf-gcc -o pngtest pngtest.o -mthumb -mthumb-interwork -L. -L../zlib-1.2.2 -lpng -lz -lm -s c:\proyectos\nds\devkitpro\devkitarm\bin\..\lib\gc c\arm-elf\4.0.2\..\..\..\..\ar
m-elf\bin\ld.exe: crt0.o: No such file: No such file or directory
make: *** [pngtest] Error 1

I have been able to compile: SDL 1.2.9 and zlib, only xDDD. I am very bad compiling things ^^

Thanks :D

did you change the makefile to match your environment?

maybe post it here and either i or someone else can make some more suggestions.

Troy

Morpheo17
April 9th, 2006, 12:53
Truth, the problem was in my Makefile. Now, i change the makefile to match with NDS but give another error XDDD

My MakeFile:



ZLIBINC = ../zlib-1.2.2
ZLIBLIB = ../zlib-1.2.2

png$(O): png.h pngconf.h
pngerror$(O): png.h pngconf.h
pngget$(O): png.h pngconf.h
pngmem$(O): png.h pngconf.h
pngpread$(O): png.h pngconf.h
pngread$(O): png.h pngconf.h
pngrio$(O): png.h pngconf.h
pngrtran$(O): png.h pngconf.h
pngrutil$(O): png.h pngconf.h
pngset$(O): png.h pngconf.h
pngtest$(O): png.h pngconf.h
pngtrans$(O): png.h pngconf.h
pngwio$(O): png.h pngconf.h
pngwrite$(O): png.h pngconf.h
pngwtran$(O): png.h pngconf.h
pngwutil$(O): png.h pngconf.h

OBJS = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O) \
pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) pngset$(O) \
pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O)

SUBDIRS=


CC=arm-elf-gcc
CXX=arm-elf-g++
LDSHARED=$(CXX)
AR=arm-elf-ar rc
RANLIB=arm-elf-ranlib

CFLAGS = -mthumb -mthumb-interwork \
-mcpu=arm9tdmi -mtune=arm9tdmi \
-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
-DARM9 -D__NDS__ -I$(DEVKITPRO)/libnds/include -DENABLE_NDS -DDISABLE_THREADS -DPACKAGE=\"SDL\" -DVERSION=\"1.2.9\" -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 \
-Iinclude -Isrc -Isrc/audio -Isrc/cdrom -Isrc/endian -Isrc/events -Isrc/joystick -Isrc/thread/nds -Isrc/thread -Isrc/timer -Isrc/video -I$(ZLIBINC) -L$(ZLIBLIB)


CXXFLAGS +=$(CFLAGS)

all: $(DEVKITPRO)/libnds/lib/libpng.a

$(DEVKITPRO)/libnds/lib/libpng.a: $(OBJS)
$(AR) $@ $(OBJS)
-@ ($(RANLIB) $@ || true) >/dev/null 2>&1


clean: clean_subdirs

subdirs: $(patsubst %, _dir_%, $(SUBDIRS))

$(patsubst %, _dir_%, $(SUBDIRS)):
$(MAKE) -C $(patsubst _dir_%, %, $@)

clean_subdirs: $(patsubst %, _clean_dir_%, $(SUBDIRS))

$(patsubst %, _clean_dir_%, $(SUBDIRS)):
$(MAKE) -C $(patsubst _clean_dir_%, %, $@) clean

#include $(DEVKITARM)/ds_rules

The error:

C:\Proyectos\NDS\SDL\libpng-1.2.8>make
arm-elf-gcc -mthumb -mthumb-interwork -mcpu=arm9tdmi -mtune=arm9tdmi -O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion -DARM9 -D__NDS__ -I/C/Proyectos/NDS/devkitpro/libnds/include -DENABLE_NDS -DDISABLE_THREADS -DPACKAGE=\"SDL\" -DVERSION=\"1.2.9\" -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -Iinclude -Isrc -Isrc/audio -Isrc/cdrom -Isrc/endian -Isrc/events -Isrc/joystick -Isrc/thread/nds -Isrc/thread -Isrc/timer -Isrc/video -I../zlib-1.2.2 -L../zlib-1.2.2 png.c png.h pngconf.h -o png
png.c: In function 'png_free_data':
png.c:569: warning: negative integer implicitly converted to unsigned type
pngconf.h:1175: error: syntax error before '*' token
pngconf.h:1175: warning: type defaults to 'int' in declaration of 'png_zcharp'
pngconf.h:1175: warning: data definition has no type or storage class
pngconf.h:1176: error: syntax error before '*' token
pngconf.h:1176: warning: type defaults to 'int' in declaration of 'png_zcharpp'
pngconf.h:1176: warning: data definition has no type or storage class
pngconf.h:1177: error: syntax error before '*' token
pngconf.h:1177: warning: type defaults to 'int' in declaration of 'png_zstreamp'

pngconf.h:1177: warning: data definition has no type or storage class
make: *** [png] Error 1

:( :( i hate the makefiles ^^

GPF
April 10th, 2006, 05:18
do you have zlib-1.2.2 source code directory above libpng directory?

ie.
/prj/zlib-1.2.2
/prj/libpng-1.2.8

the file thats throwing the error is missing the declaration of a type, thats defined by zlib i believe, libpng is dependant on zlib.

Troy

protomank
December 11th, 2009, 18:52
I'm having a similar problem:


iuri@ubuntu-vm:~/devkitpro/examples/joytestsdl$ make
testjoystick.c
arm-eabi-gcc -MMD -MP -MF /home/iuri/devkitpro/examples/joytestsdl/build/testjoystick.d -g -Wall -O2 -mcpu=arm9tdmi -mtune=arm9tdmi -fomit-frame-pointer -ffast-math -mthumb -mthumb-interwork -I/home/iuri/devkitpro/libnds/include -I/home/iuri/devkitpro/libnds/include -I/home/iuri/devkitpro/examples/joytestsdl/build -DARM9 -c /home/iuri/devkitpro/examples/joytestsdl/source/testjoystick.c -o testjoystick.o
linking joytestSDL.elf
/home/iuri/devkitpro/libnds/lib/libSDL.a(SDL_ndsvideo.o): In function `NDS_VideoInit':
SDL_ndsvideo.c:(.text+0x538): undefined reference to `powerON'
SDL_ndsvideo.c:(.text+0x58a): undefined reference to `consoleInitDefault'
collect2: ld returned 1 exit status
make[1]: ** [/home/iuri/devkitpro/examples/joytestsdl/joytestSDL.elf] Erro 1
make: ** [build] Erro 2
iuri@ubuntu-vm:~/devkitpro/examples/joytestsdl$

Burbruee
January 2nd, 2010, 14:21
I have a problem compilig sdl examples as well.



C:\devkitPro\examples\nds\sdl\rectSDL>make
linking rectSDL.elf
c:/devkitPro/libnds/lib\libSDL.a(SDL_ndsvideo.o): In function `NDS_VideoInit':
SDL_ndsvideo.c:(.text+0x62e): undefined reference to `consoleInitDefault'
collect2: ld returned 1 exit status
make[1]: *** [/c/devkitPro/examples/nds/sdl/rectSDL/rectSDL.elf] Error 1
make: *** [build] Error 2

Would love to get some simple SDL code up and running on the DS.

Some info: Installed latest devkitpro (devkitARM r27, libnds 1.4.0)
Downloaded precompiled SDL from here:
http://gpf.dcemu.co.uk/ndsSDL.shtml

Put header files in C:\devkitpro\libnds\include\
and libsdl.a in C:\devkitpro\libnds\lib\

Didn't know where to put template folder, so didn't extract that one.

Downloaded the examples and tried to 'make' one.

ventis
April 23rd, 2010, 23:21
I can't understand why SDL does not work.
I use Windows 7 , i installed devkitpro , downloaded SDL libs and headers for Nintendo ds put in the right directories in the hard disk but when i type make on the terminal i get this error.

C:\nds\fireSDL>make
linking fireSDL.elf
c:/devkitPro/libnds/lib\libSDL.a<SDL_ndsvide.o>: In function 'NDS_VideoInit':
SDL_ndsvideo.c:(.text+0x60e):undefined reference to 'vramSetBankH'
SDL_ndsvideo.c:(.text+0x614):undefined reference to 'vramSetBankI'
SDL_ndsvideo.c:(.text+0x62e):undefined reference to 'consoleInitDefault'
collect2: ld returned 1 exit sttus
make[1]: *** [/g/nds/fireSDL/fireSDL.elf] Error 1
make: *** [build] Error 2


Please help!:confused: