Importing a module from another directory

Derix via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Dec 27 09:36:38 PST 2014


I try to compile the basic HelloWorld.d example in which I only
added

    import Journal;

where Journal is a module I defined in Journal.d in another
directory.

So I have

/home/derix/development/publishing/journal/journal.d

and

/home/derix/development/examples/helloworld/main.d

I work with MonoDevelop. In Project/Project Options/Includes I
specified /home/derix/development/publishing/journal

Building from MonoDevelop spews the following command line

dmd -debug -gc "main.d"  "-I/usr/include/dmd"
"-I/home/derix/development/publishing/journal" "-odobj/Debug"
"-of/home/derix/development/example/helloworld/bin/Debug/example"
-w

and the following error
--- errorlevel 1
obj/Debug/example.o:(.data+0x78): undefined reference to
`_D7Journal12__ModuleInfoZ'


What am I missing ? Or, to put it more simply, what would be the
correct dmd command line to import a module defined in a sibling
directory ?


Thanks,


More information about the Digitalmars-d-learn mailing list