[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] Multiple definition errors (was: Error in SDL-1.2.13-1.m68kmint.rpm)



Am Montag, den 21.06.2010, 10:29 +0200 schrieb Vincent Rivière
>> I think SDL-1.2.12-1 RPM Contains an error in the sdl.pc pkg-config
>> file.
>> 
>> It defines the following linker flags: -lSDL  -lgem -lldg -lgem
> 
> You didn't say what the error is...
> 
> The fact -lgem appears twice ?

Ok, than this seems to be no failure. But I inspected the multiple
definition error a bit further. 
It's actually caused by the -Wl,--whole-archive flag. If I change it to
-Wl,--whole-archive it links OK, but then the lib is not working anymore. 

Details:

when linking netsurf:

The errors (no more...!):

/usr/lib//libgem.a(vq_calibrate.o):vq_calibrate.o:(.text+0x0): multiple
definition of `_vq_calibrate'
/usr/lib//libgem.a(vq_calibrate.o):vq_calibrate.o:(.text+0x0): first
defined here


    this does not work (above mentioned errors occur):
    LDFLAGS += -Wl,--whole-archive $(shell $(PKG_CONFIG) --libs libnsfb)
-Wl,--no-whole-archive 
    LDFLAGS += -lm
    
    this does link, but runtime error occurs (the lib says : sdl backend
not available)
    LDFLAGS += -Wl,--no-whole-archive $(shell $(PKG_CONFIG) --libs
libnsfb) -Wl,--no-whole-archive 
    LDFLAGS += -lm
    
    info:
    $(shell $(PKG_CONFIG) --libs libnsfb) expands to:
    -L/usr/local/lib -lnsfb -lSDL -lldg -lgem
    
    this is partial content of sdl.pc:
    Libs: -L${libdir}  -lSDL -lgem -lldg -lgem    
    
    if I change it to: 
    Libs: -L${libdir}  -lSDL -lldg
    
    and pass -lgem manually: 
    LDFLAGS += -lgem -lm
    
    everything works fine ( lib has sdl backend, no linker errors)  
    
Greets,
Ole