std.boxer broken?
Sean Kelly
sean at f4.ca
Fri Apr 14 09:31:33 PDT 2006
Daniel Keep wrote:
> Aaah, I see. I actually had a poke around the .lib files after I wrote
> that, and noticed that phobos didn't have a debug .lib -- is that what
> causes it?
Yes. Template code is kind of weird in that it isn't compiled until
instantiated, but the DMD compiler generates non-template functions to
handle in/out clauses and asserts. So if you use a debug app with
template code containing asserts and such from a library that wasn't
built with -debug set, then the assert functions won't exist in that
library. The easiest way around this for library programmers making
mixed-mode libraries is to always compile modules containing templates
with -debug set, but this is only feasible if the module *only* contains
templates. This isn't the case for std.boxer, so there are two options:
* ship release and debug builds of Phobos
* fix the compiler to always generate debug code for templates and rely
on it being thrown out by the linker if it is not needed
> If that is the case, would I be able to compile my own so that I can
> produce a debug version of my executables?
Yes.
Sean
More information about the Digitalmars-d
mailing list