www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How to import modules from another folder ?

reply Vinod K Chandran <kcvinu82 gmail.com> writes:
Hi all,
I am practicing some win32 api coding in D. So far so good. But 
when i tried to import some d files from another folder, i wonder 
how do this. This is my folder structure.

--> Source Folder
----------> app.d  //This is my main file. I am importing guiLib 
in this main file.
----------> guiLib.d // This file contains some public imports 
like, Gui.d, Button.d etc
----------> LibFolder // this is a folder
-----------------> Gui.d
-----------------> Button.d
-----------------> Label.d

Do i need to pass the exact path ?
May 13 2020
parent Vinod K Chandran <kcvinu82 gmail.com> writes:
On Wednesday, 13 May 2020 at 22:10:02 UTC, Vinod K Chandran wrote:
 Hi all,
 I am practicing some win32 api coding in D. So far so good. But 
 when i tried to import some d files from another folder, i 
 wonder how do this. This is my folder structure.

 --> Source Folder
 ----------> app.d  //This is my main file. I am importing 
 guiLib in this main file.
 ----------> guiLib.d // This file contains some public imports 
 like, Gui.d, Button.d etc
 ----------> LibFolder // this is a folder
 -----------------> Gui.d
 -----------------> Button.d
 -----------------> Label.d

 Do i need to pass the exact path ?
Hi all, Sorry for bothering you. I think i found the answer myself. If a d file which you want to import in your main file is in another directory, then just write this - "import YourDirectory.YourFile"
May 13 2020