I am trying to link a static library that I created, but I get this error.
libmine.a: could not read symbols: Archive has no index; run ranlib to add one
I tried to do ranlib libmine.a but nothing changed, it still gives the same error. How can I solve this problem?
To see the symbols in an archive, use nm.
<output>
The entry points to the subroutines should be labled “T” as in
What switches did you use in “ar” to make the static library? I usually use “ar -r” as in
If you are still having problems, add the “-s” option
Also, be sure that there are no other “libmine.a” files in the path, or make an explicit path to your “libmine.a”. It is possible the linker is picking up a different “libmine.a”.