library dependencies nightmare, D edition

Steven Schveighoffer schveiguy at gmail.com
Tue Feb 25 21:48:00 UTC 2020


On 2/25/20 4:31 PM, Marcel wrote:
> Hello!
> I have two libraries, where library B depends on library A, where both 
> libraries consist of multiple packages. Say my project (I'm using 
> VisualD) folder layout is the following:
> 
> C/:
>     libA
>        A_Package1
>        A_Package2
>        A_Package3
>     libB
>        B_Package1 - Imports from libA.Package2
>        B_Package2
>        B_Package3
>        Executable Module - Imports from libB.Package1
> 
> Why am I getting "Error: module "Package1" is in file libA\Package2 
> which cannot be read" messages? I tried changing the folder layout so 
> that LibA is inside a dependencies folder inside LibB, but nothing 
> changed. What am I missing?
> 

It would be most helpful to have actual messages, because you might be 
missing something.

Several causes for such errors:

1. You are trying to read a file that it cannot find given the command 
line parameters
2. The file has a module that is different from the actual package/file 
it is in.

Could be something else too. Maybe you have the same package name from 
both libraries? That should work, as long as you don't define the same 
module in both packages.

-Steve


More information about the Digitalmars-d-learn mailing list