Active Topics

 


Reply
Thread Tools
Posts: 270 | Thanked: 239 times | Joined on Dec 2009 @ Czech Republic
#1
Hi, i need some help with makefile. This is error:
/scratchbox/compilers/cs2007q3-glibc2.5-arm7/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lSDL-1.2
collect2: ld returned 1 exit status
make: *** [gles2n64.so] Error 1
adn here is makefile:
Code:
ARCH = ARM
OS = LINUX
#ARCH = X86
#OS = WIN32


CFLAGS  = -Wall -pipe -O3
LDFLAGS = -L/scratchbox/users/figa/targets/FREMANTLE_ARMEL/usr/lib



ifeq ($(ARCH), X86)


SO_EXTENSION = dll
CXX = C:/MinGW/bin/g++
LD = C:/MinGW/bin/g++
CFLAGS += -IC:/MinGW/include
CFLAGS += -IC:/MinGW/include/SDL
CFLAGS += -IC:/MinGW/include/PVR
CFLAGS += -IC:/MinGW/include/libpng12
CFLAGS += -DINLINE_OPT -m32


else



COMPILER_DIR = /scratchbox/compilers/cs2007q3-glibc2.5-arm7
SO_EXTENSION = so
CXX = 	g++
LD = 	g++
INCLUDE	= /scratchbox/users/figa/targets/FREMANTLE_ARMEL/usr/include
CFLAGS 	+= -I$(INCLUDE)/libpng12
CFLAGS 	+= -I$(INCLUDE)/SDL
CFLAGS	+= -I$(INCLUDE)
CFLAGS 	+= -I$(COMPILER_DIR)/arm-none-linux-gnueabi/libc/lib
CFLAGS  += -march=armv7-a -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ffast-math \
		  -fsingle-precision-constant  -ftree-vectorize -funroll-loops \

		  -fexpensive-optimizations -fomit-frame-pointer






CFLAGS  += -D__NEON_OPT -D__VEC4_OPT -DARM_ASM  -DINLINE_OPT
#CFLAGS += -D__PACKVERTEX_OPT 
endif

ifeq ($(OS), LINUX)
CFLAGS += -Wall -D__LINUX__ -fPIC

LDFLAGS += -lEGL -lGLESv2 -lsrv_um -lSDL-1.2 -lpng12 -lz -lIMGegl
else
CFLAGS += -Wall
LDFLAGS +=  -LC:/MinGW/lib/PVR -lSDLmain -lSDL -lpng -lGLESv2
endif


#CFLAGS += -DPROFILE_GBI
#CFLAGS += -DSHADER_TEST

OBJECTS =

# list of object files to generate
OBJECTS = Config.o \

    gles2n64.o \
	OpenGL.o \
	N64.o \
	RSP.o \
	VI.o \
	Textures.o \
	ShaderCombiner.o \
	gDP.o \
	gSP.o \
	GBI.o \
	DepthBuffer.o \
	CRC.o \
	2xSAI.o \
	RDP.o \
	F3D.o \
	F3DEX.o \
	F3DEX2.o \
	L3D.o \
	L3DEX.o \
	L3DEX2.o \
	S2DEX.o \
	S2DEX2.o \
	F3DPD.o \
	F3DDKR.o \
	F3DWRUS.o

# build targets
all: gles2n64.$(SO_EXTENSION)

clean:
	del -f *.o *.s *.ii *.$(SO_EXTENSION) ui_gln64config.*

# build rules
.cpp.o:
	$(CXX) -o $@ $(CFLAGS) -c $<

.c.o:
	$(CXX) -o $@ $(CFLAGS) -c $<

ui_gln64config.h: gln64config.ui
	$(UIC) $< -o $@

gles2n64.$(SO_EXTENSION): $(OBJECTS)
	$(CXX) $^ $(LDFLAGS) $(SDL_LIBS) $(LIBGL_LIBS) -shared -o $@

gles2n64.o: gles2N64.cpp
	$(CXX) $(CFLAGS) $(SDL_FLAGS) -DMAINDEF -c -o $@ $<

Config_qt4.o: Config_qt4.cpp ui_gln64config.h
	$(CXX) $(CFLAGS) $(SDL_FLAGS) -c -o $@ $<

Config_gtk2.o: Config_gtk2.cpp
	$(CXX) $(CFLAGS) $(SDL_FLAGS) -c -o $@ $<

GBI.o: GBI.cpp
	$(CXX) $(CFLAGS) $(SDL_FLAGS) -c -o $@ $<
Thank for your reply.
 
Posts: 726 | Thanked: 345 times | Joined on Apr 2010 @ Sweden
#2
Supply the actual compiler output.

Do you really have a file named libSDL-1.2.so.<something> in any directory that you're adding with the -L flag?

This lines looks weird:

CFLAGS += -I$(COMPILER_DIR)/arm-none-linux-gnueabi/libc/lib

-I is used to add directories for #include operations. libc/lib looks like a place with dynamically linkable libraries.
 

The Following User Says Thank You to Joorin For This Useful Post:
Posts: 270 | Thanked: 239 times | Joined on Dec 2009 @ Czech Republic
#3
Yes I have here LDFLAGS = -L/scratchbox/users/figa/targets/FREMANTLE_ARMEL/usr/lib Ok I changed it, but still doesn´t work.
 
Posts: 726 | Thanked: 345 times | Joined on Apr 2010 @ Sweden
#4
Again, supply the actual compiler output. You're only showing the last step with linking.

To actually see all flags and their values, it would help to see what is done.
 

The Following User Says Thank You to Joorin For This Useful Post:
Posts: 270 | Thanked: 239 times | Joined on Dec 2009 @ Czech Republic
#5
Sorry.
Code:
[sbox-FREMANTLE_ARMEL: ~/mupen/gles2n64] > make all
g++ Config.o gles2n64.o OpenGL.o N64.o RSP.o VI.o Textures.o ShaderCombiner.o gDP.o gSP.o GBI.o DepthBuffer.o CRC.o 2xSAI.o RDP.o F3D.o F3DEX.o F3DEX2.o L3D.o L3DEX.o L3DEX2.o S2DEX.o S2DEX2.o F3DPD.o F3DDKR.o F3DWRUS.o -L/scratchbox/users/figa/targets/FREMANTLE_ARMEL/usr/lib -lEGL -lGLESv2 -lsrv_um -lSDL-1.2 -lpng12 -lz -lIMGegl   -shared -o gles2n64.so
/scratchbox/compilers/cs2007q3-glibc2.5-arm7/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lSDL-1.2
collect2: ld returned 1 exit status
make: *** [gles2n64.so] Error 1
 
Posts: 726 | Thanked: 345 times | Joined on Apr 2010 @ Sweden
#6
This
Code:
gles2n64.$(SO_EXTENSION): $(OBJECTS)
	$(CXX) $^ $(LDFLAGS) $(SDL_LIBS) $(LIBGL_LIBS) -shared -o $@
would, in my eyes, look more proper like this
Code:
gles2n64.$(SO_EXTENSION): $(OBJECTS)
	$(CXX) $(LDFLAGS) $(SDL_LIBS) $(LIBGL_LIBS) -shared -o $@ $^
Where are SDL_LIBS and LIBGL_LIBS defined? It looks like you didn't show the right makefile.

To help the linker, you can use -l:libSDL-1.2.so.0 to give the full name of the library you want to link against.

You should also note that when compiling C++ code, CXXFLAGS is typically used and there are already rules built into make to handle .cpp => .o files. Try to write as few rules of your own as possible and use the proper variables instead.
 
Reply


 
Forum Jump


All times are GMT. The time now is 21:47.