GP32 Compile Problems


Zotty

Member
Joined
Aug 1, 2004
Messages
205
Location
Netherlands
Website
www.schijf.org
Today I downloaded Mirko's GP32 SDK replacement and am trying to compile the hello world tutorial to get started. However, I've run into a little trouble and am hoping someone can help me. I've been using the supplied makefile template.

When I run 'make' it says it doesn't know the object file (hello.o), which is logical because the source is not yet compiled. So I did the following to compile it by hand:

Code:
arm-elf-gcc -o hello.o -c hello.c

And here's where I'm stuck at the moment. It doesn't recognize the GP32 system includes (#include <gp32.h> in this case). How is this fixed?

PS, I'm working under from the console under win2k. ARM GCC version is 3.4.0 and Mirko's SDK 0.8.5
 

Zotty

Member
Joined
Aug 1, 2004
Messages
205
Location
Netherlands
Website
www.schijf.org
But offcourse!

The make error:
Code:
C:\gp32_MrMirko\gp32_SDK\test>make
MAKE Version 5.1  Copyright (c) 1987, 1998 Borland Internation
Fatal: 'hello.o' does not exist - don't know how to make it

The compile error:
Code:
C:\gp32_MrMirko\gp32_SDK\test>arm-elf-gcc -o hello.o hello.c
hello.c:100:77: gp32.h: No such file or directory
hello.c: In function `main':
hello.c:110: error: `FRAMEBUFFER' undeclared (first use in this function)
hello.c:110: error: (Each undeclared identifier is reported only once
hello.c:110: error: for each function it appears in.)
hello.c:105: warning: return type of 'main' is not `int'

The makefile:
Code:
CC = arm-elf-gcc
LD = arm-elf-gcc
AS = arm-elf-as
AR = arm-elf-ar

# change this to your project name (your-main-file).c
PRG = hello

LIBS = ../lib/gp_common.a ../lib/gp_font8.a
INCLUDES = -I../lib.src/include
CFLAGS = $(INCLUDES) -O2 -s  -mtune=arm9tdmi

# Add all of (your-.c-file).o here
OBJS = hello.o crt0.o struct.o

all:	$(OBJS)

# Add all of (your-.c-file).o after $(PRG).elf
	$(LD) -nostartfiles -s -Wall -Wl,-Map,Test.map  -T lnkscript crt0.o -o $(PRG).elf $(PRG).o $(LIBS)
	arm-elf-objcopy -O binary $(PRG).elf $(PRG).bin

# change Mirko_Roller to your name and DoubleBuffered_fx to the title of your program
	b2fxec -a Eelco_Schijf -t Hello_Test $(PRG).bin $(PRG).fxe

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

Added path "c:\gp32_MrMirko" to the environment variables. The project is located in the "gp32_SDK" directory.
 

Dalto

Certified Guru
Joined
Jun 13, 2004
Messages
266
Location
Just north of Mexico
Website
Visit site
OK,

There are a few things that I noticed

1. You need the bin directory in your path c:\gp32_MrMirko\bin
2. You need to make sure that is in your path before the directory that contains borlands make.(I suspect this is your problem)
3. If you are going to call arm-elf-gcc by hand make sure you include the -I line from the make file. Otherwise, it won't be able to find the headers.

Let us know if this fixes it for you.
 

Zotty

Member
Joined
Aug 1, 2004
Messages
205
Location
Netherlands
Website
www.schijf.org
It works now!

The problem was indeed that it used Borland's make instead of the GP32 make version. Putting the latter before of Borland's path setting did the trick.

Furthermore I had to make a change to the makefile:

Before:
Code:
LIBS = ../lib/gp_common.a ../lib/gp_font8.a

After:
Code:
LIBS = -L../lib -lmirkoSDK

Thanks for helping me get started.
 
Top