Two method for linking a object using GCC ?

Posted by bluewater on Stack Overflow See other posts from Stack Overflow or by bluewater
Published on 2010-06-09T10:23:07Z Indexed on 2010/06/09 10:52 UTC
Read the original article Hit count: 210

Filed under:
|
|

I've known that I should use -l option for liking objects using GCC. that is gcc -o test test.c -L./ -lmy

But I found that "gcc -o test2 test.c libmy.so" is working, too.

When I use readelf for those two executable I can't find any difference. Then why people use -l option for linking objects? Does it have any advantage?

© Stack Overflow or respective owner

Related posts about c

    Related posts about gcc