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

Re: [MiNT] Error in SDL-1.2.13-1.m68kmint.rpm



m0n0 a écrit :
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 ?
It is sometimes mandatory when libraries have interdependencies.
The important thing to understand is that the order of the libraries on the linker command line is significant: they are loaded from left to right. Normally, the most specific libs should appear first, then the most generic ones. If a library makes use of a previously used library, AND the required symbols have not been already satisfied, it is necessary to put the libraries on the command line once again to avoid unresolved externals.

The above example suggests that libgem has dependencies to libldg (which is quite improbable) and libldg has dependencies to libgem.

For information, ld has a special options --start-group and --end-group which can be abbreviated to -( and -) Libraries listed between these options are searched repeatedly until no new undefined references are created. The documentation says this should be used only when unavoidable due to performance costs.

For example, the following options could do the trick here:
-( -lSDL  -lgem -lldg -)

--
Vincent Rivière