August 14, 2010
> Search paths are never platform-independent.

True, but relative paths work. dmd also recognizes something like -I../.. on Windows.
August 14, 2010

mrmocool at gmx.de wrote:
>> Search paths are never platform-independent.
>
> True, but relative paths work. dmd also recognizes something like -I../.. on Windows.
>

Using / for paths on Windows sometimes works, often and unpredictably not.
August 14, 2010
Walter Bright, el 14 de agosto a las 01:45 me escribiste:
> Leandro Lucarella wrote:
> >Walter Bright, el 13 de agosto a las 18:46 me escribiste:
> >>Leandro Lucarella wrote:
> >>>What I do think is important is an option to ignore pragma(lib) entirely, because even when is not very common, users might want to link against an specific custom library name. For example in Debian sometimes there are packages for the same library but configured in different ways, like libcurl and libcurl-gnutls.
> >>>
> >>>I opened a bug report: http://d.puremagic.com/issues/show_bug.cgi?id=4642
> >>>
> >>http://www.digitalmars.com/ctg/ctgLinkSwitches.html#defaultlibrarysearch
> >
> >As stated in the bug report, you either don't understand me, or I don't understand you. I'm not talking about library search, I'm talking about automatic linking against libraries.
> 
> The switch causes the linker to ignore library names embedded in the object file. I believe this is exactly what you asked for.

Again, I don't use Windows, I don't know if this is a non-problem in Windows, but *it is* in Linux, where as you say no library names are embedded in the object file and instead DMD just call the linker with -lnameofthelib, and you can't avoid that (AFAIK, please correct me if I'm wrong).

-- 
Leandro Lucarella (AKA luca)                     http://llucax.com.ar/
----------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------
He cometido pecados, he hecho el mal, he sido v?ctima de la envidia, el
ego?smo, la ambici?n, la mentira y la frivolidad, pero siempre he sido
un padre argentino que quiere que su hijo triunfe en la vida.
	-- Ricardo Vaporeso
August 14, 2010

Leandro Lucarella wrote:
>
> Again, I don't use Windows, I don't know if this is a non-problem in Windows, but *it is* in Linux, where as you say no library names are embedded in the object file and instead DMD just call the linker with -lnameofthelib, and you can't avoid that (AFAIK, please correct me if I'm wrong).
>
> 

You're right, it does do that on linux. I'd forgotten. Sorry.
August 15, 2010
Yes, in NT 3.51, there was a fix to make forward slashes always work:

http://support.microsoft.com/kb/133701

Other than that, backslash is only required for UNC paths (i.e. \\servername\share\path).   But that has nothing to do with relative paths.

IMO, it's not that important that DMD supports universal options across platforms.  It's more natural for someone on that platform to deal with what they are used to.  DMD isn't Java.

If it takes a couple version statements or a couple different lines in a makefile so dmd doesn't have to deal with the various linker option differences, I think that's fine.

-Steve



----- Original Message ----
> From: Walter Bright <walter at digitalmars.com>
> To: Discuss the internals of DMD <dmd-internals at puremagic.com>
> Sent: Sat, August 14, 2010 2:33:37 PM
> Subject: Re: [dmd-internals] Shouldn't there be a dmd switch to specify search
>paths for libraries?
> 
> 
> 
> mrmocool at gmx.de wrote:
> >> Search  paths are never platform-independent.
> > 
> > True, but relative paths  work. dmd also recognizes something like -I../.. on
>Windows.
> > 
> 
> Using / for paths on Windows sometimes works, often and unpredictably  not.
> _______________________________________________
> dmd-internals mailing  list
> dmd-internals at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-internals
> 



August 15, 2010

Steve Schveighoffer wrote:
> Yes, in NT 3.51, there was a fix to make forward slashes always work:
>
> http://support.microsoft.com/kb/133701
> 

Sorry, I keep running into cases where it doesn't work.

August 16, 2010
Walter Bright wrote:
> 
> 
> mrmocool at gmx.de wrote:
>>>     -L-Lpath
>>> works for me on Linux.
>>
>> Well good old friend optlink doesn't support something like that. And the LIB variable is overwritten by the content specified in sc.ini I think.
>>
> 
> dmd will pass any switch directly to the linker with the -L command. I know optlink has a problem with lib paths, but such is not fixable by enhancing pragmas, but by enhancing optlink.

dmd could add a library search path for optlink by adding it to the LIB environment variable. The work-around for Visual D is to manually modify sc.ini, appending %DMD_LIB% to the respective line and passing additional paths through that environment variable when building.

(BTW: LIB is a dangerous environment variable for optlink because it is widely used by other compilers, and libraries of unsupported formats can cause optlink to fail without reporting an error.)

If modifying optlink is such a hassle, it would be nice if dmd could modify the LIB environment variable from a command line switch.

Rainer

ps: I tried to send this message before through gmane, but was not subscribed to the list, so it did not seem to get through. sorry if it is a duplicate now.

1 2 3
Next ›   Last »