diff --git a/vlib/db/pg/README.md b/vlib/db/pg/README.md index ec15a9f199..d9349d94e3 100644 --- a/vlib/db/pg/README.md +++ b/vlib/db/pg/README.md @@ -69,6 +69,11 @@ format *PG_VERSION_NUM 17* without 0 also should work 7. Add libpq.dll to v/thirdparty/pg/win64 +If you are going to use the msvc compiler: +7. Add libpq.lib(C:\Program Files\PostgreSQL\{version}\lib) to v/thirdparty/pg/win64/msvc + +8. Add libpq.dll, libcrypto-3-x64.dll, libssl-3-x64.dll to where your executable is. + To get the libpq.dll file, you can install the PostgreSQL database, and get this dll from its bin/ folder, or compile DB from source code. ``` diff --git a/vlib/db/pg/pg.c.v b/vlib/db/pg/pg.c.v index 049a36b967..eb64d05f26 100644 --- a/vlib/db/pg/pg.c.v +++ b/vlib/db/pg/pg.c.v @@ -6,7 +6,11 @@ import orm $if $pkgconfig('libpq') { #pkgconfig --cflags --libs libpq } $else { - #flag -lpq + $if msvc { + #flag -llibpq + } $else { + #flag -lpq + } #flag linux -I/usr/include/postgresql #flag darwin -I/opt/local/include/postgresql11