.di header imports with DLL symbols fails to link

Daniel Green venix1 at gmail.com
Sat Mar 12 20:50:18 PST 2011


On 3/12/2011 11:39 PM, Bekenn wrote:
> On 3/12/2011 7:02 PM, Andrej Mitrovic wrote:
>> My commands to compile were:
>> dmd -ofmydll.dll mydll.d
>> dmd -o- -Hdinclude mydll.d
>> dmd driver.d mydll.lib -I%cd%\include
>
> Thanks.
>
> I've tried several things, but can't get the _D5mydll12__ModuleInfoZ
> symbol to show up at all. The behavior is the same with and without a
> .def file (I tried a few versions). I even went back to
> http://www.digitalmars.com/d/2.0/dll.html and copied everything
> in the "D code calling D code in DLLs" section verbatim. After fixing a
> few compilation errors (the web page's version of concat needs its
> arguments qualified with "in"), I ended up with the exact same problem
> you're experiencing.
>
> I'd definitely call this a bug.

Probably unrelated, but this same issue showed up in the GDC backend. 
Apparently, the compiler tried to be smart about exporting ModuleInfo 
only for those modules that needed it.  The fix was to always export it 
regardless.


More information about the Digitalmars-d-learn mailing list