Question about libraries

Bill Baxter dnewsgroup at billbaxter.com
Tue May 29 19:39:30 PDT 2007


Ary Manzana wrote:
> Hello.
> 
> First of all, this question has nothing to do with DFL.
> 
> When I compile a program with DFL (i.e. "dfl program.d ..."), it 
> translates the command to "dmd.exe ..." with some extra parameters. One 
> of those parameters is
> 
> -L/exet:nt/su:windows:4.0 C:\ary\PROGRA~1\d\dmd\lib\DFL_DE~1.LIB
> 
> What is the meaning of that?

Like you say below, the -L stuff is passed to the linker, so you should 
be able to check the linker docs for what all that means.  The linker 
help says the following:
C:\> link -h
...
EXET[ype]
SU[bsystem]
...

Granted that's not very informative, but it's saying that the program 
should be linked as an 'nt' type executable with the 'windows' version 
'4.0' subsystem.  The only thing I think you really need to give users 
the option of changing there is the 'windows' part.  For a console app 
you need to change that to 'console'.

The part after that is just a library to link to, so I assume you know 
what that's for.

> I'm asking this question because we'll make Descent configurable for 
> building projects, and for that a user should specify include paths, 
> libraries, and some flags. But, I don't understand how the -L switch 
> works. The documentation just says:
> 
> -Llinkerflag
>     pass linkerflag to the linker, for example, /ma/li

Yeh, it just means dmd -L/ma/li will call the linker like

    link.exe /ma/li

> Another question: are include paths and libraries enough for compiling a 
> file and linking everything, or am I missing something?

I think so.  sc.ini has a DFLAGS and a LINKCMD variable so I guess those 
are necessary too.  But if you're invoking dmd, then presumably you'll 
be getting that already.

--bb


More information about the Digitalmars-d-learn mailing list