[Issue 6605] Add switch to enable setting library search paths via command line

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 5 12:25:24 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6605



--- Comment #2 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2011-09-05 12:25:14 PDT ---
(In reply to comment #1)
> Actually, you can do that with the rather obscure notation
> 
> dmd main.d -I..\..\src mylib.lib -L..\..\

No, you can't. That's what I was saying. Look:

.\fold1\fold2\main.d
.\foo.d


.\fold1\fold2\main.d:
import foo; 
void main() { auto x = foothing(); }

.\foo.d:
int foothing() { return 1; }

$ dmd -lib foo.d
$ cd fold1\fold2
$ md main.d -I..\..\ foo.lib -L..\..\

OPTLINK : Warning 9: Unknown Option : NOI..\..\
foo.lib
 Warning 2: File Not Found foo.lib
main.obj(main)

The LIB environment variable would be very useful if the default sc.ini didn't
overwrite it but prepend it by default. Instead of this line:

LIB="%@P%\..\lib";\dm\lib

we would have this line:
LIB="%@P%\..\lib";\dm\lib;%LIB%

Then I could actually use LIB via a shell script without having to touch
sc.ini, e.g. continuing my previous example and with the sc.ini change I could
do:

$ set LIB=..\..\;%LIB%
$ dmd main.d -I..\..\ foo.lib

And voila, it works. But unfortunately the default sc.ini setting overwrites
LIB instead of prepending to it.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list