www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - linker query

reply Ty Tower <tytower hotmail.com.au> writes:
I notice my libraries are called 
libphobos.a
libtango-base-dmd.a
libtangobos.a
etc

So when I compile a program with dmd the command put out is so
dmd MyStuff/main.d
gcc main.o -o main -m32 -Xlinker -L/usr/bin/../lib -ltango-user-dmd
-ltango-base-dmd -lpthread -lm


so with the "-l" switch above  , does that get converted internally  to the
prefix "lib"  ? 
Feb 16 2008
parent "Neil Vice" <psgdg swiftdsl.com.au> writes:
"Ty Tower" <tytower hotmail.com.au> wrote in message 
news:fp7l1j$1j19$1 digitalmars.com...
I notice my libraries are called
 libphobos.a
 libtango-base-dmd.a
 libtangobos.a
 etc

 So when I compile a program with dmd the command put out is so
 dmd MyStuff/main.d
 gcc main.o -o 
 main -m32 -Xlinker -L/usr/bin/../lib -ltango-user-dmd -ltango-base-dmd
-lpthread 
  -lm


 so with the "-l" switch above  , does that get converted internally  to 
 the prefix "lib"  ?
Yes this is exactly what happens. Under linux (and possibly others) libxxx.a is the standard naming convention for the file containing a static library named xxx. As such, only the 'name' of the library is required by GCC and it is expanded to the filename internally as you say.
Feb 16 2008