Visual D: Settings to Improve compil and link process

ParticlePeter via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jul 7 03:46:39 PDT 2014


On Sunday, 6 July 2014 at 19:27:38 UTC, Rainer Schuetze wrote:

> Ok, that allows separate compilation of the class, but 
> templates are still compiled with the rest of the program. I 
> thought the templates were the part that cause the slow 
> compilation.

I had no chance to profile till now, but I don't think that the 
templates are slow. They just extract type information from 
primitive or struct arrays, and pass the type info and void array 
on. I have the impression that the whole rebuild-relink process 
of the library itself was taking so long, so I wanted ensure that 
the non-templte code ( the majority ) does not have to be 
compiled over and over again.

> These object files are in the library ;-) That means manual 
> selection, though, as incremental builds to multiple object 
> files don't work with dmd, and single file compilation is 
> painfully slow.

Not sure if I am getting this right, so when one object file has 
to be recompiled all other object files, even if up to date, 
would be recompiled ?

>> The modules form MyProject do import the MyLib modules 
>> properly, I do
>> not get compiler errors. However, the compiler should create 
>> Object
>> files from MyLib modules, and the linker should link them. But 
>> he does not.
>> On the other hand, when I add MyLib modules to MyProject ( 
>> Rightclick
>> MyProject - add - existing item... MyLib source files ) then 
>> linking
>> works. I do not understand why the later step is necessary.
>
> dmd does not compile imported modules, but rdmd does.

Ähm ... not seeing the connection here either, why is this 
significant ?

I feel that I could not explain my problem properly, so one 
example:
Importing phobos modules. I do not have to define any import path 
or lib file in the project settings, I just need to import 
std.somthing. That's because the import path for phobos modules 
are stored in the dmd sc.ini file.
When I want to import my modules which are somewhere on my 
hard-drive and not added to my project I need to tell the 
compiler where these modules can be found, using the additional 
import path project setting. That's fine, doing this.

But result is, std.somthing works, my modules in a path known by 
the compiler don't work, giving me linker errors. Why ? ( I do 
not create a lib, I just want to import the module. )




More information about the Digitalmars-d-learn mailing list