On Mon, 07 Jul 2014 11:19:36 GMT, akaDemik wrote:

Hi.

I try to build Windows DLL using http://wiki.dlang.org/Win32_DLLs_in_D.

Problem with file dll.def. It is not used when linking. My dub.json:

{
	"name": "MyName",
	"description": "MyDesc",
	"authors": [ "Self" ],

	"targetType": "dynamicLibrary",
	"targetPath": "../../bin/",
	"targetName": "MyLib.1.0",
	
	"sourceFiles": ["source/dll.def"],
}

I called dub -v build -force.

dmd -c -of.dub\build\library-debug-windows-x86-dmd-8D6716356D4F1B731020AE588FCDD4F9\MyLib.1.0.obj -debug -g -w -version=Have_myname -Isource source\dll.def source\dll.d
dmd -of.dub\build\library-debug-windows-x86-dmd-8D6716356D4F1B731020AE588FCDD4F9\MyLib.1.0.dll .dub\build\library-debug-windows-x86-dmd-8D6716356D4F1B731020AE588FCDD4F9\MyLib.1.0.obj -shared -g

At compile dll.def not needed, but is present. At the stage of linking the file is needed, but not specified. As a result, the file is ignored. How to add the file "dll.def" to the link step?

Thank you.

I've added .def to the list of recognized linker files in b3b96f0. You may also be able to work around this issue by setting "lflags-windows-dmd": ["/IMPDEF:$PACKAGE_DIR\\source\\dll.def"] or similar (I'm not sure if that parameter syntax is correct).