db.pg: fix compilation error with the msvc compiler on windows, and add readme (#20326)

This commit is contained in:
André ldev 2024-01-01 18:22:15 -03:00 committed by GitHub
parent f53031feda
commit 363d4e1f5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -69,6 +69,11 @@ format *PG_VERSION_NUM 17* without 0 also should work
7. Add libpq.dll to v/thirdparty/pg/win64 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, 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. and get this dll from its bin/ folder, or compile DB from source code.
``` ```

View File

@ -6,7 +6,11 @@ import orm
$if $pkgconfig('libpq') { $if $pkgconfig('libpq') {
#pkgconfig --cflags --libs libpq #pkgconfig --cflags --libs libpq
} $else { } $else {
$if msvc {
#flag -llibpq
} $else {
#flag -lpq #flag -lpq
}
#flag linux -I/usr/include/postgresql #flag linux -I/usr/include/postgresql
#flag darwin -I/opt/local/include/postgresql11 #flag darwin -I/opt/local/include/postgresql11