motorollin
Member
- Joined
- Jul 31, 2007
- Messages
- 163
I have never set up a dev environment in Linux before. In Dev-C++ under Windows it's all done for you. I'm trying to modify a Dev-C++ makefile to get my game to compile and run under Linux. Here's what I've done so far:
CODE
# Project: GridWars2x
# Makefile created by Dev-C++ 4.9.9.2
CPP = g++
CC = gcc
OBJ = linux/main.o linux/spriteclasses.o
LINKOBJ = linux/main.o linux/spriteclasses.o
LIBS = -L/opt/open2x/gcc-4.1.1-glibc-2.3.6/lib -lSDL_image -lSDL_mixer -lSDL_ttf -lSDL_inifile -lSDL -lpng -ljpeg -lvorbisidec -lmad -lfreetype -lz -lunicodefont
INCS = -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include/SDL -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include/SDL_mixer
CXXINCS = -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include/c++/4.1.1/backward -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include/c++/4.1.1 -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include/SDL -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include/SDL_mixer
BIN = gridwars2x
CXXFLAGS = $(CXXINCS) -DLINUX
CFLAGS = $(INCS) -D_REENTRANT -DLINUX
RM = rm -f
MKDIR = mkdir -p
.PHONY: all all-before all-after clean clean-custom
all: all-before gridwars2x all-after
all-before:
$(MKDIR) "linux"
clean: clean-custom
${RM} $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CPP) $(LINKOBJ) -o $@ $(LIBS)
linux/main.o: main.c
$(CPP) -c main.c -o linux/main.o $(CXXFLAGS)
linux/spriteclasses.o: spriteclasses.cpp
$(CPP) -c spriteclasses.cpp -o linux/spriteclasses.o $(CXXFLAGS)
When I do `make -f Makefile.linux` I get errors like "/usr/bin/ld: skipping incompatible /opt/open2x/gcc-4.1.1-glibc-2.3.6/lib/libSDL_mixer.so when searching for -lSDL_mixer" and "/usr/bin/ld: skipping incompatible /opt/open2x/gcc-4.1.1-glibc-2.3.6/lib/libSDL_mixer.so when searching for -lSDL_mixer". I get similar errors for SDL_image.
CODE
# Project: GridWars2x
# Makefile created by Dev-C++ 4.9.9.2
CPP = g++
CC = gcc
OBJ = linux/main.o linux/spriteclasses.o
LINKOBJ = linux/main.o linux/spriteclasses.o
LIBS = -L/opt/open2x/gcc-4.1.1-glibc-2.3.6/lib -lSDL_image -lSDL_mixer -lSDL_ttf -lSDL_inifile -lSDL -lpng -ljpeg -lvorbisidec -lmad -lfreetype -lz -lunicodefont
INCS = -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include/SDL -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include/SDL_mixer
CXXINCS = -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include/c++/4.1.1/backward -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include/c++/4.1.1 -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include/SDL -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include/SDL_mixer
BIN = gridwars2x
CXXFLAGS = $(CXXINCS) -DLINUX
CFLAGS = $(INCS) -D_REENTRANT -DLINUX
RM = rm -f
MKDIR = mkdir -p
.PHONY: all all-before all-after clean clean-custom
all: all-before gridwars2x all-after
all-before:
$(MKDIR) "linux"
clean: clean-custom
${RM} $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CPP) $(LINKOBJ) -o $@ $(LIBS)
linux/main.o: main.c
$(CPP) -c main.c -o linux/main.o $(CXXFLAGS)
linux/spriteclasses.o: spriteclasses.cpp
$(CPP) -c spriteclasses.cpp -o linux/spriteclasses.o $(CXXFLAGS)
When I do `make -f Makefile.linux` I get errors like "/usr/bin/ld: skipping incompatible /opt/open2x/gcc-4.1.1-glibc-2.3.6/lib/libSDL_mixer.so when searching for -lSDL_mixer" and "/usr/bin/ld: skipping incompatible /opt/open2x/gcc-4.1.1-glibc-2.3.6/lib/libSDL_mixer.so when searching for -lSDL_mixer". I get similar errors for SDL_image.