IrenejMarc/dpq

Use on windows

Opened this issue · 1 comments

Getting libpq.lib to cooperate on windows with Dlang was a nightmare... basically no documentation to fix the problems and I had to get some assistance from the D community on discord to solve the problem.

Any chance I could convince you to update your readme with some sort of note about getting it to run on windows? (I dont know if the usage was simpler back in postgres-v10 which had some larger differences... every version since has been a bit messy and generally follows my setup -> It only works for windows-x64 since then)

"Rename libpq.lib to pq.lib" inside C:/Program Files/PostgreSQL//lib

Include the following to the bottom of the dub file for windows to pull deps and use libpq

"libs": [ "pq" ],
"lflags-windows": [ "-LIBPATH:C:/Program Files/PostgreSQL/<VERSION>/lib/" ],
"copyFiles-windows": [
	"C:/Program Files/PostgreSQL/<VERSION>/lib/libpq.dll",
        "C:/Program Files/PostgreSQL/<VERSION>/bin/libintl-9.dll",
        "C:/Program Files/PostgreSQL/<VERSION>/bin/libssl-1_1-x64.dll",
        "C:/Program Files/PostgreSQL/<VERSION>/bin/libcrypto-1_1-x64.dll"
]

(Obviously replace with the version of pg being used...)

I know this would help anyone else trying to use your dub binding greatly :)

o3o commented

Thank you Damien for you suggestion..
I'm sorry but last time I used windows the American president was Clinton and the Italian was Berlusconi :)

if you want you can change the readme, any PR is welcome!