Multi-library project path issue

#coder supetronix.dev1 at gmail.com
Thu May 24 23:15:30 PDT 2012


Hi,

I am using the Mono-D for building a project with 3-4 library 
projects and one console project. Although I am using the Mono-D 
but I think this issue is not unique to Mono-D. Please advise me 
with a solution, if I am missing something obvious here.

Issue;

I have two "library" project with something similar to following:

AppFolder  (AppFolder contains the below two folders for 
individual project)

Lib1
  |
  ------ TestFile1.d
  |
  ------ TestFile2.d (import TestFile1;) // TestFile2 is importing 
TestFile1 in same library project.


Lib2  (Lib2 has linker path to "lib1.a" and include path to 
"AppFolder")
|
------ TestFile3.d (import Lib1.TestFile2).


If I compile the Lib1 folder alone then it will work fine but now 
if I compile the Lib2 folder then the error will be in 
"TestFile2.d" of Lib1 project that "TestFile1" is not found. If I 
change the "Import" in TestFile2 to

import Lib1.TestFile1;

Then the compilation of Lib2 starts to work. Now, if I try to 
compile the Lib1 project alone in Mono-D (I also tried same on 
D-IDE) then it will not compile.

I was ok with compiling only the Lib2 but now the next issue is 
that the code completion won't work in "Lib1.TestFile2" after 
changing the import statement (simply because Lib1.TestFile1 is 
not valid path for it any more).


What should I do? How are other people working on multi-library 
projects in D? I tried to look into generating the ".di" files 
but I don't think that will work either. I looked at "Phobos" and 
it uses the convention like "Lib1.TestFile2" (std.conv) but I 
don't think it will help me with the compilation of Lib1 project.


Thanks




More information about the Digitalmars-d-learn mailing list