On Friday, 14 October 2022 at 21:38:45 UTC, Yura wrote:
in the top of my el.d file I have:
```D
/+dub.sdl:
dependency "mir-algorithm" version="~>3.16.12"
+/
import std.stdio;
import std.string;
import std.conv;
import std.exception : assertThrown;
import std.math;
import mir.ndslice;
```

however, when I try to compile it (gdc el.d) it gives me the following error message:

el.d:11:8: error: module ndslice is in file 'mir/ndslice.d' which cannot be read
 import mir.ndslice;

This all looks good, except for the `"gdc el.d"` part. A small application contained in a single .d file can be run like a script via `"dub el.d"`. This is explained at https://dub.pm/advanced_usage.html

For compiling highly optimized final binaries you can run `"dub build --build=release --single --compiler=ldc2 el.d"` (to use LDC) or `"dub build --build=release --single --compiler=gdc el.d"` (to use GDC).

Reply via email to