.di header imports with DLL symbols fails to link

Andrej Mitrovic none at none.none
Sat Mar 12 17:24:11 PST 2011


On Windows, x86.

http://dl.dropbox.com/u/9218759/DLL_Imports.zip

fail_build.bat runs:
dmd driver.d mydll.lib -I%cd%\include\
but linking fails:
driver.obj(driver)
 Error 42: Symbol Undefined _D5mydll12__ModuleInfoZ
--- errorlevel 1

work_build.bat runs:
dmd driver.d mydll.lib %cd%\include\mydll.di
and this succeeds.

So passing the .di file explicitly works, but via the import switch it does not.

Here's a non-DLL example which works fine when using header files and an import switch:
http://dl.dropbox.com/u/9218759/importsWorkUsually.zip

So unless I'm missing something this looks like a linker bug?


More information about the Digitalmars-d-learn mailing list