Mike McTernan wrote:
Tom St Denis wrote:
Mike McTernan wrote:
Hi,
I'm trying to wrap the functions in a library and having some
problems
when static linking with GNU ld version 2.17.
<snip>
Are there any pointers or ideas as to how I can get this working?
Don't you normally run ranlib on the .a to build an index table first?
I thought ranlib was just a speed thing, rather than performing any sort
of linking which is what I'm after here.
From what I understand ranlib makes an index of exported symbol names
so the linker has one list to work with. Otherwise it's the "to the
right rule," for example, if a.o depends on b.o then you'd do
gcc a.o b.o -o prog
whereas
gcc b.o a.o -o prog
wouldn't work.
So if you did
ar r test.a b.o a.o
Without ranlib, the link would probably fail.
Tom