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 > Trouble compiling libpogo2

#173954 - JackUzi - Mon May 10, 2010 12:10 am

Hello. I am trying to compile libpogo and glkpogo using devkitarm but aren't having much luck so far. I am very new to DS development so I was hoping someone might me able to tell me what I am doing wrong.

I am developing on Ubuntu 10.4 and have the following environment variables set:

Code:

DEVKITARM=/opt/devkitpro/devkitARM
DEVKITPRO=/opt/devkitpro


When I run configure, with what may or may not be the correct arguments I get:

Code:
~/svn/pogo2/libpogo$ ./configure --enable-platform=NDS --host=arm-eabi --build=arm-eabi --prefix=/opt/devkitpro/devkitARM/
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
configure: Selected ARM based platform NDS
configure: Using ../../libnds as libnds location
checking build system type... arm-unknown-eabi
checking host system type... arm-unknown-eabi
checking for freetype-config... freetype-config
checking for arm-eabi-gcc... arm-eabi-gcc
checking whether the C compiler works... no
configure: error: in `/home/stuart/svn/pogo2/libpogo':
configure: error: C compiler cannot create executables
See `config.log' for more details.

The relevant section from config.log appears to be:Configured with:

Code:
 ../../gcc-4.4.3/configure --enable-languages=c,c++,objc --with-cpu=arm7tdmi --enable-interwork --enable-multilib --with-gcc --with-gnu-ld --with-gnu-as --disable-dependency-tracking --disable-shared --disable-threads --disable-win32-registry --disable-nls --disable-debug --disable-libmudflap --disable-libssp --disable-libgomp --disable-libstdcxx-pch --target=arm-eabi --with-newlib --prefix=/opt/devkitpro/devkitARM --with-bugurl=http://wiki.devkitpro.org/index.php/Bug_Reports --with-pkgversion='devkitARM release 30'
Thread model: single
gcc version 4.4.3 (devkitARM release 30)
configure:2898: $? = 0
configure:2887: arm-eabi-gcc -V >&5
arm-eabi-gcc: '-V' option must have argument
configure:2898: $? = 1
configure:2887: arm-eabi-gcc -qversion >&5
arm-eabi-gcc: unrecognized option '-qversion'
arm-eabi-gcc: no input files
configure:2898: $? = 1
configure:2918: checking whether the C compiler works
configure:2940: arm-eabi-gcc  -mthumb-interwork -specs=ds_arm9.specs   conftest.c  >&5
/opt/devkitpro/devkitARM/lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/lib/ds_arm9_crt0.o: In function `CIDLoop':
(.init+0x1c0): undefined reference to `__libnds_mpu_setup'
/opt/devkitpro/devkitARM/lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/lib/ds_arm9_crt0.o: In function `CIDLoop':
(.init+0x210): undefined reference to `initSystem'
/opt/devkitpro/devkitARM/lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/lib/ds_arm9_crt0.o: In function `CIDLoop':
(.init+0x21c): undefined reference to `__libnds_exit'
collect2: ld returned 1 exit status
configure:2944: $? = 1
configure:2982: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "libpogo"
| #define PACKAGE_TARNAME "libpogo"
| #define PACKAGE_VERSION "2.0"
| #define PACKAGE_STRING "libpogo 2.0"
| #define PACKAGE_BUGREPORT "jonas@nightmode.org"
| #define PACKAGE_URL ""
| #define PACKAGE "libpogo"
| #define VERSION "2.0"
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:2987: error: in `/home/stuart/svn/pogo2/libpogo':
configure:2991: error: C compiler cannot create executables


It seems to make the the compiler arm-eabi-gcc doesn't seem to like a lot of the arguments passed to it (and delegates all the real work to gcc anyway???) If anyone can offer any advice on what to try next it would be greatly appreciated!

Stuart

#173956 - Dwedit - Mon May 10, 2010 1:37 am

Is this that code from Pogoshell that does bankswitching on the various different flash cartridges?

I bet it would need some changes to go from the GBA to the NDS.

Kuwanger seems to have taken over Pogoshell, so maybe direct some questions towards him.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#173958 - JackUzi - Mon May 10, 2010 1:55 am

Thanks for the suggestion, but it appears the PogoShell may be unrelated (or another app based on libpogo?). This is a site that talks a bit about GlkPogo, which seems to use libpogo for screen display and input: http://www.qj.net/qjnet/nintendo-ds/text-adventures-on-the-ds-glk-pogo-v10.html

It also seems to me that the errors are more relating to my configure options than the libpogo code itself. It seems the the app itself looks for the NDS platform target, and I have experimented with no --build or a build of something like i486-linux-gnu, but still without luck.

If I use:

Code:

./configure --host=arm-eabi --prefix=/opt/devkitpro/devkitARM/


./configure runs to completion but then make fails with:

Code:

mv -f .deps/libpogo_a-memory.Tpo .deps/libpogo_a-memory.Po
arm-eabi-gcc -DHAVE_CONFIG_H -I. -I..  -O2 -DPLATFORM=PC -I../include -DLIBPOGO  -DUSE_SDL -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT    -MT libpogo_a-device.o -MD -MP -MF .deps/libpogo_a-device.Tpo -c -o libpogo_a-device.o `test -f 'device.c' || echo './'`device.c
In file included from /usr/include/SDL/SDL_main.h:26,
                 from /usr/include/SDL/SDL.h:30,
                 from device.c:90:
/usr/include/SDL/SDL_stdinc.h:63:22: error: strings.h: No such file or directory
In file included from /usr/include/SDL/SDL_main.h:26,
                 from /usr/include/SDL/SDL.h:30,
                 from device.c:90:
/usr/include/SDL/SDL_stdinc.h:151: error: size of array 'SDL_dummy_enum' is negative


It seems that --enable-platform=NDS prevents the use of SDL, but with that option ./configure fails with this error again:

Code:

configure:2940: arm-eabi-gcc  -mthumb-interwork -specs=ds_arm9.specs   conftest.c  >&5
/opt/devkitpro/devkitARM/lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/lib/ds_arm9_crt0.o: In function `CIDLoop':
(.init+0x1c0): undefined reference to `__libnds_mpu_setup'
/opt/devkitpro/devkitARM/lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/lib/ds_arm9_crt0.o: In function `CIDLoop':
(.init+0x210): undefined reference to `initSystem'
/opt/devkitpro/devkitARM/lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/lib/ds_arm9_crt0.o: In function `CIDLoop':
(.init+0x21c): undefined reference to `__libnds_exit'


Seems like a bit of a catch 22 at the moment... :(

Stuart

#173964 - JackUzi - Mon May 10, 2010 8:18 am

As a bit of an update, the configure seems to work now that I use this configure line:
Code:

./configure --enable-platform=NDS --host=arm-eabi --prefix=/opt/devkitpro/devkitARM/


with these two environment variable set:

Code:

export LIBS=-lnds9
export LDFLAGS=-L/opt/devkitpro/libnds/lib


Trying to make the library itself now fails with:

Code:

make  all-recursive
make[1]: Entering directory `/home/stuart/svn/pogo2/libpogo'
Making all in src
make[2]: Entering directory `/home/stuart/svn/pogo2/libpogo/src'
arm-eabi-gcc -DHAVE_CONFIG_H -I. -I..  -O2 -DPLATFORM=NDS -I../include -DLIBPOGO -mcpu=arm9tdmi -mtune=arm9tdmi -mthumb-interwork -fomit-frame-pointer -ffast-math -I../../libnds/include -DARM9     -MT libpogo_a-key_ds.o -MD -MP -MF .deps/libpogo_a-key_ds.Tpo -c -o libpogo_a-key_ds.o `test -f 'key_ds.c' || echo './'`key_ds.c
key_ds.c:1:17: error: nds.h: No such file or directory
key_ds.c: In function 'key_update':
key_ds.c:42: error: 'REG_IF' undeclared (first use in this function)
key_ds.c:42: error: (Each undeclared identifier is reported only once
key_ds.c:42: error: for each function it appears in.)


I'm not to confident in '-I../../libnds/include' so I'll start looking for a way to specify a full path, but as always, and hints greatly appreciated...

Stuart

#173971 - JackUzi - Mon May 10, 2010 12:32 pm

Okay, so excuse me turning this thread more of a blog than a discussion, but I have been making progress...

Only now I'm truly stuck. I get the impression that perhaps this code is just starting to show it's age and isn't 100% compatible with the current version of libnds and devkitARM. I've managed to tweak a few things here and there and get many of the modules compiling now, but the button input stuff just doesn't seem to be done the way things need to be these days.

It makes references to IPC->buttons and IPC->touchXpx which I can't find defined in any of the current header files.

Can anyone confirm that there is a new way of reading input?

Stuart

#173972 - sverx - Mon May 10, 2010 2:07 pm

JackUzi wrote:
Can anyone confirm that there is a new way of reading input?


I confirm.
http://libnds.devkitpro.org/a00081.html