stupid ld tricks
H . J . Lu
hjl@lucon.org
Wed Jun 21 16:00:00 GMT 2000
On Wed, Jun 21, 2000 at 06:55:47PM -0400, Michael Sterrett -Mr. Bones.- wrote:
> I'm trying to use the -Bstatic -Bdynamic flags to ld to link certain
> libraries statically to my application and others dynamically.
>
> I had hoped something like this would work:
>
> cc -o app.o -c app.c
> ld -o app app.o -Bstatic -la -Bdynamic -lb -lc
>
Never call ld directly unless you know what you are doing. Use
gcc and -Wl,-Bstatic -la -Wl,-Bdynamic:
# gcc -o app app.o -Wl,-Bstatic -la -Wl,-Bdynamic -lb
H.J.
More information about the Binutils
mailing list