modules in other directory trees

dsmith ds at nomail.com
Wed Oct 31 16:01:50 PDT 2012


What is your way to import modules from other directory trees?  
Here is my (incorrect?) ideal:

Given:
/home/user/library_directory/

Containing:
lib_one.d
lib_two.d
lib_interface.d

lib_interface.d source:
module lib_interface;
public import lib_one, lib_two;

Implementation in program /home/user/programs/main.d:
cd /home/user/programs
ln -s /home/user/library_directory/lib_interface.d
// or include in dmd.conf: -I/path_to/library_directory

main.d source:
import lib_interface;
...

Compile program:
dmd main.d lib_interface.d



More information about the Digitalmars-d-learn mailing list