Note: This website is archived. For up-to-date information about D projects and development, please visit

Ticket #45 (closed defect: fixed)

Opened 7 years ago

Last modified 6 years ago

library search path is not added to linker

Reported by: Extrawurst Assigned to: sagitario
Priority: major Component: Language Service
Version: 0.3.23 Keywords:


I need to add a path to the linker where it is supposed to look for libraries (like dmd -L-L+..\..\_dwt\libs\) apparently "Library Search Path" does not work for that. but it should, right ?

Change History

04/28/11 05:23:07 changed by sagitario

There is no option dmd/optlink to pass the library search path, this needs to be done through an environment variable, but this is usually overwritten in dmd's sc.ini. The workaround is described here:

04/28/11 07:50:33 changed by Extrawurst

well in fact i just did pass a linker search path to the linker through dmds command line. if i add this "-L-L+LIBPATH" to the additional options in vd in my case for using dwt libs: "-L-L+..\..\_dwt\libs\" then it works. so in fact it is possible to pass a lib search path to optlink though the dmd command line

04/29/11 14:15:40 changed by sagitario

  • status changed from new to assigned.

Before I implemented the workaround, I searched the list of optlink switches up and down. But I did not expect this options to be passed like this (I think you don't need the duplicate "-L" here). It seems Walter has adopted Apple's dogma "Think different" here, aka known as the way of maximum surprise.

04/29/11 15:45:41 changed by Extrawurst

I am not sure if it works with a single "-L" i was try/erroring with that a lot ;)

05/11/11 06:31:11 changed by sagitario

Unfortunately, passing the library search path on the dmd command line does not work if def and/or resource files are also passed. Any linker options specified by -L are passed to the linker at the end of the command line, so the search path does not end up in the "lib" section of the optlink command line.

Also, I think optlink has the search order wrong. If I pass a library search path on the command line, I want it to be searched before the paths in LIB, not the other way around.

08/11/12 14:29:50 changed by sagitario

This is now finally fixed by calling the linker directly. You can try it in VisualD-v0.3.34rc1.exe

10/12/12 17:43:15 changed by sagitario

  • status changed from assigned to closed.
  • resolution set to fixed.

released in 0.3.34