Welcome to This Week in D! Each week, we'll summarize what's been going on in the D community and write brief advice columns to help you get the most out of the D Programming Language.
The D Programming Language is a general purpose programming language that offers modern convenience, modeling power, and native efficiency with a familiar C-style syntax.
This Week in D has an RSS feed.
This Week in D is edited by Adam D. Ruppe. Contact me with any questions, comments, or contributions.
See more at digitalmars.D.announce.
If you work with a large project in D, it is possible that you will be forced to face the reality that dmd has a number of bugs. Each week, we see several bugs, usually minor but sometimes major, get fixed, but in the mean time, you don't want these bugs to interrupt your development.
As such, it is helpful to be familiar with some of the harder-to-fix bugs and techniques to work around them with minimal disruption wherever possible.
Today, we will see an example of a rare bug in dmd that is difficult to fix. It has been in dmd for many years and may remain in dmd for years to come, but thankfully, it is very easy to work around: it sometimes doesn't add necessary TypeInfo data into an object file, causing a linker error.
The workaround is simple: manually add a reference for it by making a function that returns typeid(the_given_Type).toString(). You never need to call this function; simply writing it will cause the compiler to add the missing data to the object file and fix the bug.
Andy Smith came across the missing TypeInfo bug and after I helped him quickly fix it, he wrote an excellent example and description of it on GitHub.
Please see his example here now: https://github.com/smandy/dmdLinkerProb and familiarize yourself with the details, so if it happens to you, it will need to only take minutes out of your day instead of stopping you in your tracks.
To learn more about D and what's happening in D: