questions about dub

bauss via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Mar 21 14:19:52 PDT 2017


On Tuesday, 21 March 2017 at 21:01:31 UTC, thorstein wrote:
> Hi,
>
> I have questions regarding the usage of 'dub'. I'm learning D 
> under Win7. I have installed VisualD for the community edition 
> of Visual Studio and got some file i/o working.
>
> Next I would like to continue with the mir-tools for matrix 
> manipulation. I understood that I have to build them first 
> using dub. But I didn't succeed:
>
> C:\..\AppData\Roaming\dub>dub fetch mir-algorithm
> Fetching mir-algorithm 0.1.1...
> Please note that you need to use `dub run <pkgname>` or add it 
> to dependencies of your package to actually use/run it. dub 
> does not do actual installation of packages outside of its own 
> ecosystem.
>
> C:\..\AppData\Roaming\dub>dub run mir-algorithm
> Building package mir-algorithm in 
> C:\..\AppData\Roaming\dub\packages\mir-algorithm-0.1.1\mir-algorithm\
> Fetching mir-internal 0.0.5 (getting selected version)...
> Main package must have a binary target type, not sourceLibrary. 
> Cannot build.
>
> Thats where I stuck.
>
> Beside my specific problem of how to start with the mir-tools I 
> wonder how and for what purpose 'dub' is applied when building 
> projects in connection with Visual Studio? Or is it just a more 
> light-weight command line build tool?
>
> Thanks for shedding some light!
> Thorstein

Generally if your dub.json or dub.sdl is configured correctly 
then all you need is to run "dub build" which will invoke package 
fetching etc. and then your desired compiler.

Dependencies are defined in dub.json / dub.sdl using 
"dependencies" which takes values as "packagename" and then 
"version".

Example: "vibe-d" "~>0.7.28"

I don't know if that helps.

I'm not familiar with Visual-D and don't use it at all, so I 
don't know if dub has to be used in specific ways. I compile 
though command line only, so.


More information about the Digitalmars-d-learn mailing list