digitalmars.D.learn - Importing module from the perspective of submodule.
- BoQsc (8/8) Jul 02 2022 Is it possible to import module that is not in the module's
- Paul Backus (7/15) Jul 02 2022 Yes. You just have to pass the folders with the modules in them
Is it possible to import module that is not in the module's current directory's folder or subfolders? For example: I want to import `somemodule2.d` and `somemodule3.d` into a **`somemodule.d`** **.\somefolder\somemodule.d** .\somemodule2.d .\someotherfolder\somemodule3.d
Jul 02 2022
On Sunday, 3 July 2022 at 05:40:30 UTC, BoQsc wrote:Is it possible to import module that is not in the module's current directory's folder or subfolders? For example: I want to import `somemodule2.d` and `somemodule3.d` into a **`somemodule.d`** **.\somefolder\somemodule.d** .\somemodule2.d .\someotherfolder\somemodule3.dYes. You just have to pass the folders with the modules in them to the compiler with the `-I` flag, or (if you're using dub) add the folders to your `importPaths`. ``` dmd -Isomeotherfolder -c somefolder\somemodule.d ```
Jul 02 2022