Thread overview
Relative lflag paths in dub on Windows
Jun 27, 2017
jmh530
Jun 28, 2017
Mike Parker
Jun 28, 2017
Mike Parker
Jun 28, 2017
jmh530
June 27, 2017
Is it possible to set relative -L paths on dub for Windows? Absolute paths work fine, just can't get relative paths working.

I was looking at the thread here
https://forum.dlang.org/post/dkwqrwzwqbrnaamlvtld@forum.dlang.org
and came up with something like
{
    ...
    "lflags": ["-L-L..\\libs\\"],
}

where the file structure contains folders dubproject\libs and dubproject\source.

It didn't work though.
June 28, 2017
On Tuesday, 27 June 2017 at 19:07:49 UTC, jmh530 wrote:
> Is it possible to set relative -L paths on dub for Windows? Absolute paths work fine, just can't get relative paths working.
>
> I was looking at the thread here
> https://forum.dlang.org/post/dkwqrwzwqbrnaamlvtld@forum.dlang.org
> and came up with something like
> {
>     ...
>     "lflags": ["-L-L..\\libs\\"],
> }
>
> where the file structure contains folders dubproject\libs and dubproject\source.
>
> It didn't work though.

You have to specify the appropriate linker option, e.g. -L-option. For gcc, that happens to -L, so you get -L-L. For optlink it's +something and for the MS linker it's /something. I'm on my phone else I'd look it up.
June 28, 2017
On Wednesday, 28 June 2017 at 00:16:23 UTC, Mike Parker wrote:
> On Tuesday, 27 June 2017 at 19:07:49 UTC,
>
> You have to specify the appropriate linker option, e.g. -L-option. For gcc, that happens to -L, so you get -L-L. For optlink it's +something and for the MS linker it's /something. I'm on my phone else I'd look it up.

Optlink instructions at [1]: -L+path\
MS linker [2]: -L/LIBPATH:path

[1] https://wiki.dlang.org/Compiling_and_linking_with_DMD_on_Windows

[2] https://docs.microsoft.com/en-us/cpp/build/reference/libpath-additional-libpath
June 28, 2017
On Wednesday, 28 June 2017 at 00:22:56 UTC, Mike Parker wrote:
> On Wednesday, 28 June 2017 at 00:16:23 UTC, Mike Parker wrote:
>> On Tuesday, 27 June 2017 at 19:07:49 UTC,
>>
>> You have to specify the appropriate linker option, e.g. -L-option. For gcc, that happens to -L, so you get -L-L. For optlink it's +something and for the MS linker it's /something. I'm on my phone else I'd look it up.
>
> Optlink instructions at [1]: -L+path\
> MS linker [2]: -L/LIBPATH:path
>
> [1] https://wiki.dlang.org/Compiling_and_linking_with_DMD_on_Windows
>
> [2] https://docs.microsoft.com/en-us/cpp/build/reference/libpath-additional-libpath

I appreciate you posting this. I had found the /LIBPATH, but dub randomly crapped out on me before I was about to test it, so I'm going to start another thread just on that...