Dlang how to make dub find external library

I am trying to compile D program with dub using DSFML library.
I am following a tutorial which explains how to compile a project with any "external" libray. After building the project, I try to compile with dub build

and it says dsfml-graphics.lib Warning 2: File Not Found dsfml-graphics.lib

one warning for each .lib file.

Now my source doesn't contain any SFML objects / classes / related instructions, it obviously compiles and generates a warning. If I use some SFML classes, obviously not.

I suppose I did something wrong inside the dub.json file, possibly in a tag -lflag

, but I'm not sure. Any idea on how to make dub find my DSLML.lib files?

This is my directory tree:

>documents
>> DSFML
>>> bin (inside, .dll files)
>>> lib
>>>> dmd (inside, .lib files)
>>>> gcd (inside, .lib files)
>> d-test-dsfml (my dub project)

      

And here is my dub.json file:

{
    "name": "d-test-sfml",
    "description": "A minimal D application.",
    "copyright": "Copyright © 2014, John",
    "authors": ["John"],
    "lflags" : ["+C:\\Users\\John\\documents\\DSFML"],
    "dependencies": {
        "dsfml:graphics": "~master",
    }
}

      

In -lflag, I also tried using [John user] \ documents \ DSFML \ bin, lib and lib \ dmd.

EDIT:, I just need to write lib\\dmd\\

(ending with two \\

). After 6 hours I will disguise it as resolved.

+3


source to share


1 answer


Write "lflags" : ["+C:\\Users\\John\\documents\\DSFML\\lib\\dmd\\"]

with two \\

at the end. Dub will now find .lib.
Like any other program, fter compilation puts .dll files \\bin

in the same .exe directory



+1


source







All Articles