Importing a module from another directory

FrankLike via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Dec 28 07:51:33 PST 2014


On Saturday, 27 December 2014 at 17:36:39 UTC, Derix wrote:
> 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,

If you use the dco,maybe it's ok:
at /home/derix/development
dco

https://github.com/FrankLIKE/dco/

Frank


More information about the Digitalmars-d-learn mailing list