Ah doh, MSVC link doesn't use -L. $ dmd -i "-L/LIBPATH:C:\Program Files\PostgreSQL\15\lib" -Llpq app.d I think that is the option you want. Worst case scenario just copy the files to your working directory and it should find it without the additional search path.