Visual D Build + DMD Bugginess = Bad

Rainer Schuetze r.sagitario at gmx.de
Wed Oct 13 14:04:21 PDT 2010


dsimcha wrote:
> I've noticed that, when passed multiple files at once, DMD is generally buggy
> in ways that I can't reproduce in small test cases.  This includes things like
> magically ignoring __gshared variables, and not being able to convert a type
> to an alias to the same type, for example, not being able to convert a size_t
> to a uint on 32-bit, or not being able to convert a float[] to an R where R is
> a template parameter instantiated as float[].
> 
> I have two questions:
> 
> 1.  Has anyone experienced similar things and if so are they further along
> than me at creating decent test cases?

I haven't run into something similar lately, but what you describe 
sounds like issues with forward references, maybe in combination with 
circular imports. Building multiple files at once can change the point 
where you enter the vicious import circle.

Could it be related to any of these?

http://d.puremagic.com/issues/show_bug.cgi?id=190
http://d.puremagic.com/issues/show_bug.cgi?id=3979

> 
> 2.  I'm used to using Code::Blocks, but want to switch to Visual D because it
> seems to work a lot better for the most part.  However, by default it seems to
> pass all project files to the compiler at once, where Code::Blocks compiles
> one file at a time.  This means I have to deal with DMD's bugginess when
> passed mutliple files at once.  Does anyone know how to make Visual D work
> Code::Blocks style, i.e. compile each file to an object file and link them
> afterwords?

I have that option on my todo list, but didn't implement it so far 
because I was not aware of any problems with compiling multiple files.

I don't know if this is really an option for a larger project, but what 
you can do is select "Custom Build Tool" for all files in the "Common 
Properties" setting of the project property dialog and enter your own 
command line and output file. But be warned: you will not get any 
automatic dependency detection.

As editing the settings for a lot of files might be very annoying, you 
might want to set it for one file and then edit the project file with a 
text editor to copy the settings to other files.

Rainer


More information about the Digitalmars-d mailing list