Importing modules under DUB on Windows

Adam D Ruppe destructionator at gmail.com
Fri Oct 28 11:35:44 UTC 2022


On Wednesday, 26 October 2022 at 16:20:01 UTC, DLearner wrote:
> Wanted to use a function stored in a module outside the main 
> source.

easiest thing to do with dub is to add it as a sourcePath or a 
sourceFile. Well, actually, easiest is to just copy the module 
right into your default src folder, but second easiest is to add 
the other thing as the sourcePath/sourceFile.

Messing with lib compiles and import paths rarely worth the 
hassle.

(and without dub btw you can make a generic lib directory, add it 
to your -I path, then just `dmd -I/path/to/libs -i 
yourmainfile.d` and it automatically picks up things from import 
paths. that's how i do it myself)


Also later i see you are using the arsd terminal.d, which you can 
also use through dub's dependency system by adding 
`arsd-official:terminal` to its list.


More information about the Digitalmars-d-learn mailing list