[SDL] Re : Re : statically linking

azer tyuiop gl_disturbedid at yahoo.fr
Wed Dec 1 07:53:32 PST 2010


I did, it change nothing. Maybe it can be helpful so here is my makefile. Note 
that by uncommenting/commenting the two successive lines LDFLAGS (to make the 
lin dynamic) it compile just fine.

Apart the static linking, Is there any other way to make my program run on a 
machine that don't have sdl?

thx


CC           = g++ 
CCFLAGS      = -Wall -g
#LDFLAGS      = `sdl-config --cfalgs --libs` -lSDL_image
LDFLAGS      = -Wl,-Bstatic -lSDL_image `sdl-config --cfalgs --static-libs` 
-Wl,-Bdynamic 

RM           = rm -f 
MAKE         = make 
INCLUDE      = -Iinclude/ext -Iinclude/contrib -Iinclude/core -Iinclude/toolBox
#HEADERS         = $(wildcard include/ext/Observers/*.h)     
SRC_C         = $(wildcard src/core/*.c src/contrib/*.c src/ext/*.c)    
SRC_CC         = $(wildcard src/core/*.cpp src/contrib/*.cpp src/ext/*.cpp 
src/toolBox/*.cpp)    

OBJ          = $(SRC_C:.c=.o) $(SRC_CC:.cpp=.o)         
TARGET       = roborobo

.IGNORE: 
#.SILENT: 

all: 
    clear
#    $(MAKE) distclean
    $(MAKE) $(TARGET) 
#    $(MAKE) clean

$(TARGET): $(OBJ)
    $(CC) $(LDFLAGS) -o $@ $^

%.o: %.cpp
    $(CC) -o $@ -c $< $(CCFLAGS) $(INCLUDE)

%.o: %.c
    $(CC) -o $@ -c $< $(CCFLAGS) $(INCLUDE)

clean:
    $(RM) $(OBJ) 

distclean:
    $(MAKE) clean 
    $(RM) $(TARGET) 



________________________________
De : Alberto Luaces <aluaces at udc.es>
À : sdl at libsdl.org
Envoyé le : Mer 1 décembre 2010, 16h 20min 08s
Objet : Re: [SDL] Re :  statically linking

azer tyuiop writes:

> I think it is to all calls of sdl functions. Here are all the errors I get at 
>building, thx in advance :
>

[...]

> collect2: ld returned 1 exit status
> make[1]: [roborobo] Erreur 1 (ignorée)

Try to use again the "--cflags" option when calling sdl-config.

-- 
Alberto

_______________________________________________
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20101201/faae11c1/attachment-0008.htm>


More information about the SDL mailing list