u9i
Call me Uni
Hi everyone
Could someone help me out please. I have followed torpor's guide ( http://www.gp32x.de/board/index.php?/topic/48635-a-slightly-more-complete-toolchain-libs-for-linux-devs/ ) to getting a build environment up and running on my computer and i have been able to compile a simple SDL (hello pixel) program. But when i take a bigger project it seems the linker is trying to link with the x86 libraries instead of the arm ones (my guess).
Here is my makefile:
And the output from make is:
I am thinking maybe it should be calling /toolchain/arm-openwiz-linux-gnu-ld instead of /toolchain/arm-openwiz-linux-gnu/bin/ld, but what do i know. I think at least it is using the wrong c++ libraries.
Does anyone have any ideas how to solve this problem?
Thanks
Uni
Could someone help me out please. I have followed torpor's guide ( http://www.gp32x.de/board/index.php?/topic/48635-a-slightly-more-complete-toolchain-libs-for-linux-devs/ ) to getting a build environment up and running on my computer and i have been able to compile a simple SDL (hello pixel) program. But when i take a bigger project it seems the linker is trying to link with the x86 libraries instead of the arm ones (my guess).
Here is my makefile:
Code:
OPEN2X = /opt/openwiz/toolchain
CC = $(OPEN2X)/bin/arm-openwiz-linux-gnu-gcc
LD = $(CC)
STRIP = $(OPEN2X)/bin/arm-openwiz-linux-gnu-strip
NAME=crazy
TARGET= $(NAME).gpe
DEFS = -DGP2X -DIS_LITTLE_ENDIAN -D_REENTRANT -DGP2X_ASM
INCS = -I. -I$(OPEN2X)/include -I$(OPEN2X)/include/SDL
LDFLAGS=$(CFLAGS) -L$(OPEN2X)/lib
LIBS = -Wl,-rpath,$(OPEN2X)/lib -lSDLmain -lSDL -lSDL_image -lSDLgfx -lSDL_mixer -lSDL_ttf -lpng -lm -lz -lpthread
OBJS = customer.o floattext.o gamescene.o hud.o ingredient.o introscene.o leveldata.o machineinstant.o machinetimebased.o main.o player.o popup.o product.o progressbar.o score.o selector.o soundplayer.o sprite.o textsprite.o trashcan.o utils.o
MYCC = $(CC) $(CFLAGS) $(INCS) $(DEFS)
########################################################################
sdl: $(TARGET)
$(TARGET): $(OBJS)
$(LD) $(LDFLAGS) $(OBJS) -o $@ $(LIBS)
$(STRIP) $@
.c.o:
$(MYCC) -c $< -o $@
clean:
rm -f *.o *.gpe
And the output from make is:
Code:
u9@vital104:~/Documents/development/crazy_sundaes/src$ make
g++ -c -o customer.o customer.cpp
g++ -c -o floattext.o floattext.cpp
g++ -c -o gamescene.o gamescene.cpp
g++ -c -o hud.o hud.cpp
g++ -c -o ingredient.o ingredient.cpp
g++ -c -o introscene.o introscene.cpp
g++ -c -o leveldata.o leveldata.cpp
g++ -c -o machineinstant.o machineinstant.cpp
g++ -c -o machinetimebased.o machinetimebased.cpp
g++ -c -o main.o main.cpp
g++ -c -o player.o player.cpp
g++ -c -o popup.o popup.cpp
g++ -c -o product.o product.cpp
g++ -c -o progressbar.o progressbar.cpp
g++ -c -o score.o score.cpp
g++ -c -o selector.o selector.cpp
g++ -c -o soundplayer.o soundplayer.cpp
g++ -c -o sprite.o sprite.cpp
g++ -c -o textsprite.o textsprite.cpp
g++ -c -o trashcan.o trashcan.cpp
g++ -c -o utils.o utils.cpp
/opt/openwiz/toolchain/bin/arm-openwiz-linux-gnu-gcc -L/opt/openwiz/toolchain/lib customer.o floattext.o gamescene.o hud.o ingredient.o introscene.o leveldata.o machineinstant.o machinetimebased.o main.o player.o popup.o product.o progressbar.o score.o selector.o soundplayer.o sprite.o textsprite.o trashcan.o utils.o -o crazy.gpe -Wl,-rpath,/opt/openwiz/toolchain/lib -lSDLmain -lSDL -lSDL_image -lSDLgfx -lSDL_mixer -lSDL_ttf -lpng -lm -lz -lpthread
/toolchain/bin/../lib/gcc/arm-openwiz-linux-gnu/4.2.4/../../../../arm-openwiz-linux-gnu/bin/ld: customer.o: Relocations in generic ELF (EM: 3)
/toolchain/bin/../lib/gcc/arm-openwiz-linux-gnu/4.2.4/../../../../arm-openwiz-linux-gnu/bin/ld: customer.o: Relocations in generic ELF (EM: 3)
/toolchain/bin/../lib/gcc/arm-openwiz-linux-gnu/4.2.4/../../../../arm-openwiz-linux-gnu/bin/ld: customer.o: Relocations in generic ELF (EM: 3)
/toolchain/bin/../lib/gcc/arm-openwiz-linux-gnu/4.2.4/../../../../arm-openwiz-linux-gnu/bin/ld: customer.o: Relocations in generic ELF (EM: 3)
/toolchain/bin/../lib/gcc/arm-openwiz-linux-gnu/4.2.4/../../../../arm-openwiz-linux-gnu/bin/ld: customer.o: Relocations in generic ELF (EM: 3)
/toolchain/bin/../lib/gcc/arm-openwiz-linux-gnu/4.2.4/../../../../arm-openwiz-linux-gnu/bin/ld: customer.o: Relocations in generic ELF (EM: 3)
/toolchain/bin/../lib/gcc/arm-openwiz-linux-gnu/4.2.4/../../../../arm-openwiz-linux-gnu/bin/ld: customer.o: Relocations in generic ELF (EM: 3)
/toolchain/bin/../lib/gcc/arm-openwiz-linux-gnu/4.2.4/../../../../arm-openwiz-linux-gnu/bin/ld: customer.o: Relocations in generic ELF (EM: 3)
/toolchain/bin/../lib/gcc/arm-openwiz-linux-gnu/4.2.4/../../../../arm-openwiz-linux-gnu/bin/ld: customer.o: Relocations in generic ELF (EM: 3)
customer.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** [crazy.gpe] Error 1
I am thinking maybe it should be calling /toolchain/arm-openwiz-linux-gnu-ld instead of /toolchain/arm-openwiz-linux-gnu/bin/ld, but what do i know. I think at least it is using the wrong c++ libraries.
Does anyone have any ideas how to solve this problem?
Thanks
Uni
Last edited by a moderator: