www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Linker -how it works

reply Ty Tower <tytower hotmail.com.au> writes:
Ok -previous post established  "-l" switch is replaced with"lib"

I had a look at my libraries and most end with ".a" , however the linker outpu
I am trying to analyse says in part this:-   "-lpthread -lm"

now I have no library called " libm" whatever and "libpthread" does not end
with ".a" ,rather it ends with "so.0"  . Its full title is libpthread.so.0.  

Will the linker still find and use it with that name?

Is there somewhere on digitalMars site which explains this linking process -
not that gives me a load of B/S of how good it is ?, but which explains how
these switches work like "dmd man" for instance
Feb 17 2008
parent reply Mike Parker <aldacron71 yahoo.com> writes:
Ty Tower wrote:

 now I have no library called " libm" whatever and "libpthread" does not end
with ".a" ,rather it ends with "so.0"  . Its full title is libpthread.so.0.  
 
 Will the linker still find and use it with that name?

yes, it's a Linux convention. Static libraries (.a) and shared libraries (.so) are interchangeable.
 
 Is there somewhere on digitalMars site which explains this linking process -
not that gives me a load of B/S of how good it is ?, but which explains how
these switches work like "dmd man" for instance

This is not a DMD issue. It's an aspect of the GCC backend that DMD uses on Linux. You can start here for some info: http://www.lurklurk.org/linkers/linkers.html#linker2. Look up the GCC manual (http://gcc.gnu.org/onlinedocs/) for more details.
Feb 17 2008
next sibling parent Ty Tower <tytower hotmail.com.au> writes:
Mike Parker Wrote:

 
 yes, it's a Linux convention. Static libraries (.a) and shared libraries 
 (.so) are interchangeable.

 This is not a DMD issue. It's an aspect of the GCC backend that DMD uses 
 on Linux. You can start here for some info: 
 http://www.lurklurk.org/linkers/linkers.html#linker2.

Got to here so far Mike -thanks
 
 Look up the GCC manual (http://gcc.gnu.org/onlinedocs/) for more details.

the "-lm" in the first post ,if this is turned into "libm" them I have no library of that name . Should I have or is this special ? I found no reference to it on the linker2 page above.
Feb 17 2008
prev sibling parent reply Ty Tower <tytower hotmail.com.au> writes:
Mike Parker Wrote:

 
 yes, it's a Linux convention. Static libraries (.a) and shared libraries 
 (.so) are interchangeable.

 This is not a DMD issue. It's an aspect of the GCC backend that DMD uses 
 on Linux. You can start here for some info: 
 http://www.lurklurk.org/linkers/linkers.html#linker2.

Got to here so far Mike -thanks
 
 Look up the GCC manual (http://gcc.gnu.org/onlinedocs/) for more details.

the "-lm" in the first post ,if this is turned into "libm" them I have no library of that name . Should I have or is this special ? I found no reference to it on the linker2 page above.
Feb 17 2008
parent Ty Tower <tytower hotmail.com.au> writes:
Disregard previous post -found "libm.so" which answers my question 
Feb 17 2008