Gph Sdk On Linux?


NeoGML

Still Fresh
Joined
Dec 29, 2003
Messages
73
Website
matthewylim.blogspot.com
Hi....

I've tried to write a makefile that uses the GPH Linux SDK 10.02, similar to what skeezix said in this thread. I'm running Ubuntu 8.04.

The GPH_SDK is installed in ~/GPH_SDK.

This is my makefile:

Code:
SDKBASE=/home/lim/GPH_SDK
TOOLBASE=$(SDKBASE)/tools/gcc-4.0.2-glibc-2.3.6/arm-linux/bin/arm-linux-
	

CC=$(TOOLBASE)g++
LD=$(TOOLBASE)g++
OBJECTS = FEvent.o FAnimation.o FSurface.o Fight.o FUtil.o FPlayer.o
LDFLAGS    = -L$(SDKBASE)/lib -Wl, -L$(SDKBASE)/DGE/lib -lSDL -lSDL_image -lSDLmain -lpng
INCLUDE = -I$(SDKBASE)/include -I$(SDKBASE)/DGE/include -I$(SDKBASE)/DGE/include/SDL
DEFINES= -DGP2X
CPPFLAGS= $(INCLUDE) $(DEFINES) -Wall  
	

all: $(OBJECTS) 
	
	$(CC) $(CPPFLAGS)  -c FEvent.cpp FAnimation.cpp FSurface.cpp Fight.cpp FUtil.cpp FPlayer.cpp 
	$(LD) -o WizFight.gpe $(LDFLAGS)

clean:
	rm -rf $(OBJECTS) game.o



This is my output:

Code:
g++  -I/home/lim/GPH_SDK/include -I/home/lim/GPH_SDK/DGE/include -I/home/lim/GPH_SDK/DGE/include/SDL -DGP2X -Wall    -c -o FEvent.o FEvent.cpp
g++  -I/home/lim/GPH_SDK/include -I/home/lim/GPH_SDK/DGE/include -I/home/lim/GPH_SDK/DGE/include/SDL -DGP2X -Wall    -c -o FAnimation.o FAnimation.cpp
g++  -I/home/lim/GPH_SDK/include -I/home/lim/GPH_SDK/DGE/include -I/home/lim/GPH_SDK/DGE/include/SDL -DGP2X -Wall    -c -o FSurface.o FSurface.cpp
g++  -I/home/lim/GPH_SDK/include -I/home/lim/GPH_SDK/DGE/include -I/home/lim/GPH_SDK/DGE/include/SDL -DGP2X -Wall    -c -o Fight.o Fight.cpp
Fight.cpp: In member function ‘int Fight::OnInit()’:
Fight.cpp:133: warning: deprecated conversion from string constant to ‘char*’
g++  -I/home/lim/GPH_SDK/include -I/home/lim/GPH_SDK/DGE/include -I/home/lim/GPH_SDK/DGE/include/SDL -DGP2X -Wall    -c -o FUtil.o FUtil.cpp
g++  -I/home/lim/GPH_SDK/include -I/home/lim/GPH_SDK/DGE/include -I/home/lim/GPH_SDK/DGE/include/SDL -DGP2X -Wall    -c -o FPlayer.o FPlayer.cpp
/home/lim/GPH_SDK/tools/gcc-4.0.2-glibc-2.3.6/arm-linux/bin/arm-linux-g++ -I/home/lim/GPH_SDK/include -I/home/lim/GPH_SDK/DGE/include -I/home/lim/GPH_SDK/DGE/include/SDL -DGP2X -Wall    -c FEvent.cpp FAnimation.cpp FSurface.cpp Fight.cpp FUtil.cpp FPlayer.cpp 
/home/lim/GPH_SDK/tools/gcc-4.0.2-glibc-2.3.6/arm-linux/bin/arm-linux-g++ -o WizFight.gpe -L/home/lim/GPH_SDK/lib -Wl, -L/home/lim/GPH_SDK/DGE/lib -lSDL -lSDL_image -lSDLmain -lpng
/home/lim/GPH_SDK/tools/gcc-4.0.2-glibc-2.3.6/arm-linux/bin/../lib/gcc/arm-linux/4.0.2/../../../../arm-linux/bin/ld: : No such file: No such file or directory
collect2: ld returned 1 exit status
make: *** [all] Error 1
It seems to be compiling the object files fine, but when linking the executable it just fails.
My guess is that's it's trying to use ld when it should be using g++... ? I tried to specify it using LD, but...

Anyone else have this working?
 
Last edited by a moderator:
NeoGML said:
Hi....

I've tried to write a makefile that uses the GPH Linux SDK 10.02, similar to what skeezix said in this thread. I'm running Ubuntu 8.04.

The GPH_SDK is installed in ~/GPH_SDK.

This is my makefile:

Code:
SDKBASE=/home/lim/GPH_SDK
TOOLBASE=$(SDKBASE)/tools/gcc-4.0.2-glibc-2.3.6/arm-linux/bin/arm-linux-
	

CC=$(TOOLBASE)g++
LD=$(TOOLBASE)g++
OBJECTS = FEvent.o FAnimation.o FSurface.o Fight.o FUtil.o FPlayer.o
LDFLAGS    = -L$(SDKBASE)/lib -Wl, -L$(SDKBASE)/DGE/lib -lSDL -lSDL_image -lSDLmain -lpng
INCLUDE = -I$(SDKBASE)/include -I$(SDKBASE)/DGE/include -I$(SDKBASE)/DGE/include/SDL
DEFINES= -DGP2X
CPPFLAGS= $(INCLUDE) $(DEFINES) -Wall  
	

all: $(OBJECTS) 
	
	$(CC) $(CPPFLAGS)  -c FEvent.cpp FAnimation.cpp FSurface.cpp Fight.cpp FUtil.cpp FPlayer.cpp 
	$(LD) -o WizFight.gpe $(LDFLAGS)

clean:
	rm -rf $(OBJECTS) game.o



This is my output:

Code:
g++  -I/home/lim/GPH_SDK/include -I/home/lim/GPH_SDK/DGE/include -I/home/lim/GPH_SDK/DGE/include/SDL -DGP2X -Wall    -c -o FEvent.o FEvent.cpp
g++  -I/home/lim/GPH_SDK/include -I/home/lim/GPH_SDK/DGE/include -I/home/lim/GPH_SDK/DGE/include/SDL -DGP2X -Wall    -c -o FAnimation.o FAnimation.cpp
g++  -I/home/lim/GPH_SDK/include -I/home/lim/GPH_SDK/DGE/include -I/home/lim/GPH_SDK/DGE/include/SDL -DGP2X -Wall    -c -o FSurface.o FSurface.cpp
g++  -I/home/lim/GPH_SDK/include -I/home/lim/GPH_SDK/DGE/include -I/home/lim/GPH_SDK/DGE/include/SDL -DGP2X -Wall    -c -o Fight.o Fight.cpp
Fight.cpp: In member function ‘int Fight::OnInit()’:
Fight.cpp:133: warning: deprecated conversion from string constant to ‘char*’
g++  -I/home/lim/GPH_SDK/include -I/home/lim/GPH_SDK/DGE/include -I/home/lim/GPH_SDK/DGE/include/SDL -DGP2X -Wall    -c -o FUtil.o FUtil.cpp
g++  -I/home/lim/GPH_SDK/include -I/home/lim/GPH_SDK/DGE/include -I/home/lim/GPH_SDK/DGE/include/SDL -DGP2X -Wall    -c -o FPlayer.o FPlayer.cpp
/home/lim/GPH_SDK/tools/gcc-4.0.2-glibc-2.3.6/arm-linux/bin/arm-linux-g++ -I/home/lim/GPH_SDK/include -I/home/lim/GPH_SDK/DGE/include -I/home/lim/GPH_SDK/DGE/include/SDL -DGP2X -Wall    -c FEvent.cpp FAnimation.cpp FSurface.cpp Fight.cpp FUtil.cpp FPlayer.cpp 
/home/lim/GPH_SDK/tools/gcc-4.0.2-glibc-2.3.6/arm-linux/bin/arm-linux-g++ -o WizFight.gpe -L/home/lim/GPH_SDK/lib -Wl, -L/home/lim/GPH_SDK/DGE/lib -lSDL -lSDL_image -lSDLmain -lpng
/home/lim/GPH_SDK/tools/gcc-4.0.2-glibc-2.3.6/arm-linux/bin/../lib/gcc/arm-linux/4.0.2/../../../../arm-linux/bin/ld: : No such file: No such file or directory
collect2: ld returned 1 exit status
make: *** [all] Error 1
It seems to be compiling the object files fine, but when linking the executable it just fails.
My guess is that's it's trying to use ld when it should be using g++... ? I tried to specify it using LD, but...

Anyone else have this working?

Got it working... There's actually an example makefile in the back of the manual pdf; Not for Linux, but I guess it was straightforward enough to change over.

I'll post it in a little bit.
 
Last edited by a moderator:
Something is odd your tool versions is different from mine, you sure you have the sdk from this thread: http://www.gp32x.de/board/index.php?/topic/56056-caanoo-sdk-and-some-documentation/

Also it looks like you using your local g++ at the beginning there.
 
Last edited by a moderator:
Pickle said:
Something is odd your tool versions is different from mine, you sure you have the sdk from this thread: http://www.gp32x.de/board/index.php?/topic/56056-caanoo-sdk-and-some-documentation/

Also it looks like you using your local g++ at the beginning there.


er, well, this is the Makefile that ended up working:
Code:
BUILD = TARGET


CPP     = $(TOOLBASE)g++
SDKBASE=/home/lim/GPH_SDK
TOOLBASE=$(SDKBASE)/tools/gcc-4.0.2-glibc-2.3.6/arm-linux/bin/arm-linux-
OBJECTS = FEvent.o FAnimation.o FSurface.o Fight.o FUtil.o FPlayer.o	

ifeq ($(BUILD),TARGET)


BIN     = ./build/target/WizFight.gpe
INCLUDE = -I$(SDKBASE)/DGE/include -I$(SDKBASE)/DGE/include/SDL -I$(SDKBASE)/include
CFLAGS  = -Wall -O3 
LIBS    = -L$(SDKBASE)/DGE/lib/target -L$(SDKBASE)/lib/target \
	  -lSDL -lSDL_image -lSDL_mixer -lSDL_ttf -lDGE -lglport -lopengles_lite -lpng -lz -lts -lsmpeg -lfreetype
LFLAGS  = -s

DEFINES = -DGP2X
else
BIN     = ./build/host/WizFight.o
INCLUDE = -I$(SDKBASE)/DGE/include -I$(SDKBASE)/DGE/include/SDL -I$(SDKBASE)/include
CFLAGS  = -g -Wall -fexceptions
LIBS    = -L$(SDKBASE)/DGE/lib/host -L$(SDKBASE)/lib/host \
	  -lSDLmain -lSDL -lSDL_image -lSDL_mixer -lSDL_ttf
DEFINES = -DLINUX
endif 
	

.cpp.o:
	$(CPP) $(INCLUDE) $(CFLAGS) $(DEFINES) -c $< -o $@


$(BIN):$(OBJECTS)
	$(CPP) $(OBJECTS) -o $@ $(LIBS) $(LFLAGS) 


all host target: $(BIN)

clean:

	rm -rf $(OBJECTS)

And no, I did not get the SDK from that thread, I have 10.02 (old Wiz one, not Caanoo compatible) from dl.openhandhelds.org. I guess I'll also try getting the new one (10.08).
 
Last edited by a moderator:
FYI,

I can't seem to get the host build to compile. Doesn't like any of DGE's libs in the lib/host directory. Not sure whether or not the host emulation is supposed to work outside of code blocks. I might just install SDL/everything else for linux and get a real host build.
 
NeoGML said:
FYI,

I can't seem to get the host build to compile. Doesn't like any of DGE's libs in the lib/host directory. Not sure whether or not the host emulation is supposed to work outside of code blocks. I might just install SDL/everything else for linux and get a real host build.
Oops, i'm a moron, of course it won't work on host with the arm-linux-g++ compiler... sorry
 
Last edited by a moderator:
Back
Top