I found a function that seems could be used for adding import paths: dmd.frontend.addImport (https://dlang.org/phobos/dmd_frontend.html#.addImport). But it's not clear how can I use it: dmd directory is not added to lookup by default and trying adding it gives errors:

dmd.exe -i -Ic:\D\dmd-2.086.1\src\dmd\ main.d
c:\D\dmd-2.086.1\src\dmd\dmd\dsymbol.d(231): Error: undefined identifier Symbol, did you mean class Dsymbol? c:\D\dmd-2.086.1\src\dmd\dmd\dsymbol.d(232): Error: undefined identifier Symbol, did you mean class Dsymbol? c:\D\dmd-2.086.1\src\dmd\dmd\dimport.d(105): Error: function `dmd.dimport.Import.kind` does not override any function c:\D\dmd-2.086.1\src\dmd\dmd\dimport.d(110): Error: function `dmd.dimport.Import.prot` does not override any function c:\D\dmd-2.086.1\src\dmd\dmd\dimport.d(210): Error: function `dmd.dimport.Import.importAll` does not override any function c:\D\dmd-2.086.1\src\dmd\dmd\dimport.d(270): Error: function `dmd.dimport.Import.setScope` does not override any function c:\D\dmd-2.086.1\src\dmd\dmd\dimport.d(313): Error: function `dmd.dimport.Import.isImport` does not override any function c:\D\dmd-2.086.1\src\dmd\dmd\dimport.d(318): Error: function `dmd.dimport.Import.accept` does not override any function c:\D\dmd-2.086.1\src\dmd\dmd\staticassert.d(56): Error: function `dmd.staticassert.StaticAssert.kind` does not override any function c:\D\dmd-2.086.1\src\dmd\dmd\staticassert.d(61): Error: function `dmd.staticassert.StaticAssert.accept` does not override any function c:\D\dmd-2.086.1\src\dmd\dmd\statement.d(2414): Error: function `dmd.statement.LabelDsymbol.isLabel` does not override any function c:\D\dmd-2.086.1\src\dmd\dmd\statement.d(2419): Error: function `dmd.statement.LabelDsymbol.accept` does not override any function c:\D\dmd-2.086.1\src\dmd\dmd\statement.d(2454): Error: undefined identifier code, did you mean import core? c:\D\dmd-2.086.1\src\dmd\dmd\dversion.d(54): Error: function `dmd.dversion.DebugSymbol.toChars` does not override any function c:\D\dmd-2.086.1\src\dmd\dmd\dversion.d(103): Error: function `dmd.dversion.DebugSymbol.kind` does not override any function c:\D\dmd-2.086.1\src\dmd\dmd\dversion.d(108): Error: function `dmd.dversion.DebugSymbol.accept` does not override any function c:\D\dmd-2.086.1\src\dmd\dmd\dversion.d(142): Error: function `dmd.dversion.VersionSymbol.toChars` does not override any function c:\D\dmd-2.086.1\src\dmd\dmd\dversion.d(192): Error: function `dmd.dversion.VersionSymbol.kind` does not override any function c:\D\dmd-2.086.1\src\dmd\dmd\dversion.d(197): Error: function `dmd.dversion.VersionSymbol.accept` does not override any function c:\D\dmd-2.086.1\src\dmd\dmd\doc.d(360): Error: need -J switch to import text file default_ddoc_theme.ddoc

Any ideas?

Reply via email to