Working with Modules

Guy Asking a Question via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Dec 27 18:01:23 PST 2016


I am just starting up with dmd and code::blocks. Generally I have 
as my project structure something like this (sorry if your forum 
doesn't format this nicely, use the '-'es for directory nesting):

ProjectA
    -SubProject1
    -SubProject2
ProjectB
    -SubProject1
    -SubProjectB
HopefullySomeDProject
    -main.d
Libraries
    -C
      --CLibrary1
    -CPP
      --CPPLibrary1
    -CSharp
      --CSharpLibrary1
    -D
      --HopefullySomeDLibrary
         ---test.d
Workspaces
    -csharp.sln
    -mydproject.workspace

But it seems the D module system isn't playing nice with this 
setup. I keep getting this error:

||=== Build: Debug in tester (compiler: Digital Mars D Compiler) 
===|
tester.d|4|Error: module test is in file 'test.d' which cannot be 
read|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 
second(s)) ===|

Unfortunately, neither code::blocks nor D's resources are really 
giving me any insight how I can make such a file structure work 
for me. Does D prefer more of a hierarchical structure where all 
libraries have to be in subdirectories? If so, how do people 
usually disembody the libraries from the actual projects?




More information about the Digitalmars-d-learn mailing list