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: 256
        
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