order of arguments on command line when linking
Erik Poupaert
erik.poupaert@chello.be
Sun Feb 16 22:27:00 GMT 2003
>>>> There are various ways to handle this. One is to order things
>>>> carefully. Another is to have the linker search the libraries
>>>> multiple times; see the ld manual.
Thanks, Tom.
I finally got myself to reading the gcc and ld man pages which contain the
solution:
-Xlinker --start-group myarc1.a myarc2.a myarc3.a -Xlinker --end-group
-Xlinker passes the next argument to ld
everything between --start-group and --end-group will be searched repeatedly
as needed.
That spares me indeed from ordering libraries carefully. And it also solves
cases where libraries recursively depend on each other.
More information about the Java
mailing list