GP32 Having Trouble With Mr. Mirko's Sdk (sorry!)


fdave

Final Dave
Joined
Apr 20, 2004
Messages
331
Website
www.finalburn.com
I'm having some trouble getting Mr. Mirko's SDK up and running - I tried following the various readmes, but to no avail, I still get a "cannot find "gp32.h"" when I compile.

Can I just check a few things...

Do you have one directory with the SDK in it? Called D:\gp32_MrMirko for example ?

What are the directories within this? I have:
arm-elf
bin
compile.bat
extractsdk.bat
gp32_sdk
include
info
lib
lib.src
libexec
licence
makefile
man
readme.txt
tool.bmp2raw
tool.raw2c
tool.zda_compressor
tools


Is that right? Where should the gp32.h headers files be? They started off in lib.src/include, and I tried moving them to include, but to no avail...

Here is my batch file:

PATH D:\gp32_MrMirko\bin;%PATH%
g++ Main.cpp
pause


Should I be using g++? I tried using 'gcc', but it didn't work, it just launched the Symbian compiler since that was further up my path.
 
Okay, I'm probably not much of a use, because I'm using it with linux, but:
You're mixing compiler and SDK! It's not important where you put the SDK - you just set the position in the makefile. It's more important to put the compiler's bin-dir into path.
About your gp32.h problem: I just put it in my project dir, works fine.
 
don posted on Sep 4 2004 at 09:24 PM said:
Okay, I'm probably not much of a use, because I'm using it with linux, but:
You're mixing compiler and SDK! It's not important where you put the SDK - you just set the position in the makefile. It's more important to put the compiler's bin-dir into path.
About your gp32.h problem: I just put it in my project dir, works fine.

I agree, but that's what the docs said to do - they said extract the SDK into the compiler directory ;-)

I've got a teeny bit further now, by explicitly setting the include directories (apparently this is the way you are meant to do it ;-) and dropping crt0.o and lnkscript into my directory, but now I get a strange link error:

Code:
D:\Develop\Emuport\Mirko>make
arm-elf-gcc -I/gp32_MrMirko/lib.src/include -s -mtune=arm9tdmi   -c -o Main.o Ma
in.c
arm-elf-gcc -nostartfiles -s -T lnkscript crt0.o Main.o -o Mirko.elf
/cygdrive/d/gp32_MrMirko/bin/../lib/gcc/arm-elf/3.4.0/../../../../arm-elf/bin/ld
: ERROR: Main.o uses hardware FP, whereas Mirko.elf uses software FP
/cygdrive/d/gp32_MrMirko/bin/../lib/gcc/arm-elf/3.4.0/../../../../arm-elf/bin/ld
: failed to merge target specific data of file Main.o
crt0.o(.text+0xdc): In function `start':
: undefined reference to `_init'
crt0.o(.text+0xf4): In function `start':
: undefined reference to `__bss_start__'
crt0.o(.text+0xf8): In function `start':
: undefined reference to `__bss_end__'
crt0.o(.text+0xfc): In function `start':
: undefined reference to `_fini'
Main.o(.text+0x10): In function `main':
: undefined reference to `gp_setCpuspeed'
collect2: ld returned 1 exit status
make: *** [all] Error 1

Any ideas on this one?
 
Last edited by a moderator:
It seems to me you're linking stuff from the wrong directory?! lib.src is the directory where the source code for mirko's SDK resides. -I/gp32_MrMirko/lib/ should do it possibly.
What does your Makefile look like?
 
This sounds like a problem with the Makefile. Here were was my old environment Makefile from my short mirko SDK days:

Code:
# Core Makefile for GP32 development using GCC
# Written 2002 by Christian Nowak <chnowak@web.de>
# Patched 2004 by DJWillis for DevKitAdv/GamePark SDK project
# compatability for newer GCC's using gpTC/DevKitArm
# Patched 2004 by Matthew Carras (GeneralNMX) for Mirko's SDK
# Version 2.0

# GCC Tool-chain
CC  	=	arm-elf-gcc
CXX  	=	arm-elf-g++
LD  	=	arm-elf-gcc
AS  	=	arm-elf-as
OBJCOPY  =	arm-elf-objcopy

CFLAGS  =	$(CUSER) \
    -marm \
    -march=armv4t \
          -mapcs \
          -O2 \
          -fomit-frame-pointer \
          -finline-functions \
          -fshort-enums \
          -ffast-math \
          -fshort-double \
          -mstructure-size-boundary=32 \
          -mno-thumb-interwork \
    -I$(GPTC)/lib.src/include \
    -Wno-multichar

CPPFLAGS  =	$(CUSER) \
    -marm \
    -march=armv4t \
          -mapcs \
          -O2 \
          -fomit-frame-pointer \
          -finline-functions \
          -fshort-enums \
          -ffast-math \
          -fshort-double \
          -mstructure-size-boundary=32 \
          -mno-thumb-interwork \
    -I$(GPTC)/lib.src/include \
    -Wno-multichar

# Only have one with Mirko's SDK for GP32
# GPTC is defined in your Makefile
LIBS  	=	$(GPTC)/lib/libmirkoSDK.a

# You need to use the crt0.S and lnkscript
# files in the various example directories, such as the example.sprite directory
LDSCRIPT  =	-T $(GPTC)/lnkscript $(GPTC)/mirko_sdk_crt0.o

# MAPFILE should be located in your Makefile
LDFLAGS  =	-nostartfiles -s -Wall \
    -Wl,-Map,$(MAPFILE) \
    $(LDSCRIPT)

LINK  	=	$(LD) $(LDFLAGS) -o $@ $^ $(LIBS) -lm

# Implicit Rules
%.o: %.c
	$(CC) $(CFLAGS) -c $<

%.o: %.cpp
	$(CXX) $(CPPFLAGS) -c $<

%.gxb: %.elf
	$(OBJCOPY) -O binary $< $@

%.o: %.s
	$(AS) -o $@ $<

Note that with devkitARM you may not need the linkscript.

Also, I suggest you use devkitARM instead of the gcc kit on Mirko's site. And mirko's SDK can be installed in whatever directory you want, you just need to set GPTC correctly.
 
fdave posted on Sep 4 2004 at 09:48 PM said:
don posted on Sep 4 2004 at 09:24 PM said:
Okay, I'm probably not much of a use, because I'm using it with linux, but:
You're mixing compiler and SDK! It's not important where you put the SDK - you just set the position in the makefile. It's more important to put the compiler's bin-dir into path.
About your gp32.h problem: I just put it in my project dir, works fine.

I agree, but that's what the docs said to do - they said extract the SDK into the compiler directory ;-)

I've got a teeny bit further now, by explicitly setting the include directories (apparently this is the way you are meant to do it ;-) and dropping crt0.o and lnkscript into my directory, but now I get a strange link error:

Code:
D:\Develop\Emuport\Mirko>make
arm-elf-gcc -I/gp32_MrMirko/lib.src/include -s -mtune=arm9tdmi   -c -o Main.o Ma
in.c
arm-elf-gcc -nostartfiles -s -T lnkscript crt0.o Main.o -o Mirko.elf
/cygdrive/d/gp32_MrMirko/bin/../lib/gcc/arm-elf/3.4.0/../../../../arm-elf/bin/ld
: ERROR: Main.o uses hardware FP, whereas Mirko.elf uses software FP
/cygdrive/d/gp32_MrMirko/bin/../lib/gcc/arm-elf/3.4.0/../../../../arm-elf/bin/ld
: failed to merge target specific data of file Main.o
crt0.o(.text+0xdc): In function `start':
: undefined reference to `_init'
crt0.o(.text+0xf4): In function `start':
: undefined reference to `__bss_start__'
crt0.o(.text+0xf8): In function `start':
: undefined reference to `__bss_end__'
crt0.o(.text+0xfc): In function `start':
: undefined reference to `_fini'
Main.o(.text+0x10): In function `main':
: undefined reference to `gp_setCpuspeed'
collect2: ld returned 1 exit status
make: *** [all] Error 1

Any ideas on this one?
Can we see your Makefile? Also, I assume you are using bobintrees toolchain?
 
Last edited by a moderator:
generalnmx posted on Sep 4 2004 at 10:40 PM said:
Also, I suggest you use devkitARM instead of the gcc kit on Mirko's site. And mirko's SDK can be installed in whatever directory you want, you just need to set GPTC correctly.


Oh you can use devkitARM with Mr Mirko's SDK? I didn't realise, that will be a lot easier because I already have devkitARM up and running right now

So I just include Mr. Mirko's headers and link with the .a? That should be straightforward.
I'll try it tomorrow.

Which crt0.o should I use, the one from D:\Devkitadv\arm-agb-elf\lib, or the one from D:\gp32_MrMirko\arm-elf\lib
Or doesn't it matter?
 
Last edited by a moderator:
Which crt0.o should I use, the one from D:\Devkitadv\arm-agb-elf\lib, or the one from D:\gp32_MrMirko\arm-elf\lib
Or doesn't it matter?

You'll need to recompile the crt0.S in the example.sprite directory with your compiler setup like this: arm-elf-gcc -marm -c crt0.S -o crt0.o


General, most of your compiler flags are remains of the Gamepark SDK days, they aren't necessary for MirkoSDK projects AFAIK.

What flags do you recommend then? The ones in mirko's sample makefiles aren't really impressive in my opinion, especially the -w <_<
 
fdave posted on Sep 5 2004 at 12:36 AM said:
generalnmx posted on Sep 4 2004 at 10:40 PM said:
Also, I suggest you use devkitARM instead of the gcc kit on Mirko's site. And mirko's SDK can be installed in whatever directory you want, you just need to set GPTC correctly.


Oh you can use devkitARM with Mr Mirko's SDK? I didn't realise, that will be a lot easier because I already have devkitARM up and running right now

So I just include Mr. Mirko's headers and link with the .a? That should be straightforward.
I'll try it tomorrow.

Which crt0.o should I use, the one from D:\Devkitadv\arm-agb-elf\lib, or the one from D:\gp32_MrMirko\arm-elf\lib
Or doesn't it matter?
When you use devkitARM you do not need a crt0.o. It provides one and handles the lnkscript for you. You just need to link with -specs=gp32.specs. devkitARM will do the rest.

If you really want to link in your own crt0 then grab a lnkscript and a crt0.S from Mirko's examples and compile it yourself.
 
Last edited by a moderator:
When you use devkitARM you do not need a crt0.o. It provides one and handles the lnkscript for you. You just need to link with -specs=gp32.specs. devkitARM will do the rest.

If you really want to link in your own crt0 then grab a lnkscript and a crt0.S from Mirko's examples and compile it yourself.

You're probably right, the setup I gave was before I knew about -specs=gp32.specs (I only knew about -specs=gp_gp32sdk.specs). I admit your version is better. But mine still worked ;)
 
loki666 posted on Sep 5 2004 at 04:32 PM said:
check this thread devkitARM

Sounds good, - one final question, where is the best place to get devKitArm from? I just found a RAR on someone's website, so I'm not sure if that gp32.specs thing will work (or will it work with any version of devKitArm?)

Is there a homepage for devKitArm?
 
Last edited by a moderator:
Back
Top