www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Linker command

reply "Paul" <paul example.com> writes:
Can some one tell me what this linker command means (or point me 
at some docs) please:

dmd example.d -L-L. $ 

AFAIK $  is 'all the supplied arguments' so I don't understand 
what it achieves.

(it's from the DAllegro5 example program, on Linux).

Cheers,

Paul
May 04 2015
next sibling parent "Kagamin" <spam here.lot> writes:
It compiles the example code and links it with supplied 
libraries, supposedly dallegro bindings.
May 05 2015
prev sibling parent reply "wobbles" <grogan.colin gmail.com> writes:
On Monday, 4 May 2015 at 20:34:32 UTC, Paul wrote:
 Can some one tell me what this linker command means (or point 
 me at some docs) please:

 dmd example.d -L-L. $ 

 AFAIK $  is 'all the supplied arguments' so I don't understand 
 what it achieves.

 (it's from the DAllegro5 example program, on Linux).

 Cheers,

 Paul
I'm guessing this command is to be called from a script somewhere. So then it will just pass all the arguments passed to that script to dmd. Cant really tell without more info on how it's called, but that's what it'll do.
May 06 2015
parent reply "Paul" <paul example.com> writes:
On Wednesday, 6 May 2015 at 12:41:21 UTC, wobbles wrote:
 On Monday, 4 May 2015 at 20:34:32 UTC, Paul wrote:
 Can some one tell me what this linker command means (or point 
 me at some docs) please:

 dmd example.d -L-L. $ 

 AFAIK $  is 'all the supplied arguments' so I don't understand 
 what it achieves.

 (it's from the DAllegro5 example program, on Linux).

 Cheers,

 Paul
I'm guessing this command is to be called from a script somewhere. So then it will just pass all the arguments passed to that script to dmd. Cant really tell without more info on how it's called, but that's what it'll do.
The script in its entirety is: dmd -release -ofexample example.d -L-L. $ I can compile from the prompt directly with dmd example.d -L-L. but I don't understand the syntax. dmd --help mentions -Llinkerflag but what is '-L-L.' doing?? TIA Paul
May 06 2015
parent reply "anonymous" <anonymous example.com> writes:
On Wednesday, 6 May 2015 at 19:26:40 UTC, Paul wrote:
 but I don't understand the syntax. dmd --help mentions 
 -Llinkerflag but what is '-L-L.' doing??
Passes '-L.' to the linker.
May 06 2015
parent reply "Paul" <paul example.com> writes:
On Wednesday, 6 May 2015 at 19:30:33 UTC, anonymous wrote:
 On Wednesday, 6 May 2015 at 19:26:40 UTC, Paul wrote:
 but I don't understand the syntax. dmd --help mentions 
 -Llinkerflag but what is '-L-L.' doing??
Passes '-L.' to the linker.
:D I can see that, but what does '-L.' mean exactly?
May 06 2015
next sibling parent "Paul" <paul example.com> writes:
On Wednesday, 6 May 2015 at 19:52:44 UTC, Paul wrote:
 On Wednesday, 6 May 2015 at 19:30:33 UTC, anonymous wrote:
 On Wednesday, 6 May 2015 at 19:26:40 UTC, Paul wrote:
 but I don't understand the syntax. dmd --help mentions 
 -Llinkerflag but what is '-L-L.' doing??
Passes '-L.' to the linker.
:D I can see that, but what does '-L.' mean exactly?
Ah, looks like 'all libraries in current directory'... http://stackoverflow.com/questions/5054833/using-external-library-in-d
May 06 2015
prev sibling next sibling parent Justin Whear <justin economicmodeling.com> writes:
On Wed, 06 May 2015 19:52:42 +0000, Paul wrote:

 On Wednesday, 6 May 2015 at 19:30:33 UTC, anonymous wrote:
 On Wednesday, 6 May 2015 at 19:26:40 UTC, Paul wrote:
 but I don't understand the syntax. dmd --help mentions -Llinkerflag
 but what is '-L-L.' doing??
Passes '-L.' to the linker.
:D I can see that, but what does '-L.' mean exactly?
It adds '.' to the list of directories which the linker will search when looking for the required libraries.
May 06 2015
prev sibling parent reply "anonymous" <anonymous example.com> writes:
On Wednesday, 6 May 2015 at 19:52:44 UTC, Paul wrote:
 On Wednesday, 6 May 2015 at 19:30:33 UTC, anonymous wrote:
 On Wednesday, 6 May 2015 at 19:26:40 UTC, Paul wrote:
 but I don't understand the syntax. dmd --help mentions 
 -Llinkerflag but what is '-L-L.' doing??
Passes '-L.' to the linker.
:D I can see that, but what does '-L.' mean exactly?
If the linker in question is ld, try `ld --help | grep \\-L` or `man ld`.
May 06 2015
parent "Paul" <paul example.com> writes:
On Wednesday, 6 May 2015 at 20:03:36 UTC, anonymous wrote:
 On Wednesday, 6 May 2015 at 19:52:44 UTC, Paul wrote:
 On Wednesday, 6 May 2015 at 19:30:33 UTC, anonymous wrote:
 On Wednesday, 6 May 2015 at 19:26:40 UTC, Paul wrote:
 but I don't understand the syntax. dmd --help mentions 
 -Llinkerflag but what is '-L-L.' doing??
Passes '-L.' to the linker.
:D I can see that, but what does '-L.' mean exactly?
If the linker in question is ld, try `ld --help | grep \\-L` or `man ld`.
Thanks both, got it.
May 06 2015