i want to use PostgreSQL and build a "new" LIB for "latest" Version v14
i have done it for HMG / MinGW using Source of TPQSERVER but how with BCC / MSVC :?:
Jimmy
fwh\lib\hppgsql.lib
fwh\lib\libpq.lib
and
fwh\samples\libpq.dllc:\hmg.3.4.4\1\hbpgsql\postgres.c
c:\hmg.3.4.4\1\hbpgsql\rddcopy.c
c:\hmg.3.4.4\1\hbpgsql\postgres.ch
c:\hmg.3.4.4\1\hbpgsql\hbpgsql.h
c:\hmg.3.4.4\1\hbpgsql\libpq-fe.h
c:\hmg.3.4.4\1\hbpgsql\tpostgre.prgdescription=PostgreSQL wrapper (SQL)
incpaths=.
headers=postgres.ch
libs=${_HB_DYNPREF}${hb_name}${_HB_DYNSUFF}
{unix}libs=pq
{!unix}libs=libpq
{darwin}libpaths=d:\PG\9.5\lib-hblib
-inc
-o${hb_name}
-w3 -es2
-depkeyhead=hbpgsql:libpq-fe.h
-depcontrol=hbpgsql:no{HB_BUILD_3RDEXT='no'}
-depcontrol=hbpgsql:${HB_WITH_PGSQL}
-depincpath=hbpgsql:d:\PG\9.5\include
-depimplibs=hbpgsql:d:\PG\9.5\lib\libpq.dll
-iflag={mingw64}-a
${hb_name}.hbx
postgres.c
rddcopy.c
tpostgre.prgrem this is LIBPQ.LIB from PostgreSQL
hbmk2.exe postgres.c rddcopy.c tpostgre.c -Id:\PG\9.5\include -Lc:\hmg.3.4.4\LIB-64 -llibpq-64hbmk2: Dependency 'hbpgsql' found: d:\PG\9.5\includewhat do i need to change for BCC / MSVC to use with Fivewin 64 Bit :?:
hbmk2: Found COFF .lib with the same name, falling back to using it instead of
the .dll.
hbmk2: Created import library: liblibpq.a <= d:\PG\9.5\lib\libpq.dll
hbmk2: Creating static library... libhbpgsql.a
Dear Jimmy,
You can use implib.exe to easily create them for both Borland and MSVC, 32 and 64 bits
Embarcadero Implib Version 3.3.0 Copyright (c) 1991-2014 Embarcadero Technologies, Inc.! Note : i have LibPQ.DLL (32/64 Bit) and want to build a "Import" LIB to use it with Fivewin
Syntax: IMPLIB [options] libname[.lib] [@respfile | srcname] [srcname ...]
Options:
-a Add '_' alias for MS flavor cdecl functions
-aa Force the alias even if the function already starts with '_'
-c Case sensitive symbols
-f Force imports by name (with hints)
-s Don't convert stdcall names from Microsoft mangling
-w No Warnings
Dear Jimmy,
For msvc:
implib.exe LibPQ.lib LibPQ.DLL
For bcc:
implib.exe -a LibPQ.lib LibPQ.DLL
Please notice that msvc does not provide implib.exe, as it is a Borland tool. For msvc you have to use:
dumpbin.exe /exports LibPQ.dll > LibPQ.def
lib.exe /def:LibPQ.def /OUT:LibPQ.lib
If you are using Harbour's hbmk2.exe please remember that it provides a way to automatically create the import libraries:
-depimplibs=dependency:LibPQ.dll
Not sure how the dependency is defined
fwh\lib\libpq.lib  // 32-bit implib
fwh\lib\hbpgsql.lib // harbour postegre lib
fwh\dll\postgre\libpq.dll  // from Postgre
// this dll is also in
fwh\samples\libpq.dllbuildh mypostgreappIf any users are now working with 32-bit dlls and libs we already provided with fwh now. in the next version we will endeavor to upgrade 32-bit versions to the latest and also provide 64-bit libs and dlls.
hi,
i already have a HMG App using LibPQ.DLL 64 bit Version
but "Import" LIB was build using MinGW and hbmk2
as i remember last 32 Bit Version of PostgreSQL "Server" was v9.x
LibPQ.DLL of Version 10 and later are all 64 Bit
to get LibPQ.DLL as 32 Bit you need to download PgAdmin which are still available as 32 Bit
hbmk2: Dependency 'test' found: .
Creating library libmariadb64.lib and object libmariadb64.exp
hbmk2: Created import library: libmariadb64.lib <= libmariadb64.dll
    echo c:\fwh\lib\hbpgsql.lib + >> b32.bc
    echo c:\fwh\lib\libpq.lib + >> b32.bctpostgre.prgi know to use buildh.bat ti build EXE but how to build 64 Bit LIB for MSVC :?:
postgres.c
rddcopy.c
Dear Jimmy,
Use hbmk2.exe and -hblib in the hbp file, and the files names
Antonio Linares wrote:Use hbmk2.exe and -hblib in the hbp file, and the files namesYES, that seems to work :D
-hblib  Â
-Ic:\fwh64\include
tpostgre.prg
postgres.c
rddcopy.c
-Lc:\fwh64\lib
-lFiveH64
-lFiveHC64
-lgdiplus
-lole32
-lOleDlg
-lversion
xhb.hbc
hbct.hbc
hbwin.hbc
-ldflag=/NODEFAULTLIB:msvcrt
Tpostgre.rcdescription=PostgreSQL wrapper (SQL)
incpaths=.
headers=postgres.ch
libs=${_HB_DYNPREF}${hb_name}${_HB_DYNSUFF}
{unix}libs=pq
{!unix}libs=libpqcall "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
c:\harbour64\bin\win\msvc64\hbmk2 hbpgsql.hbp -comp=msvc64
REN tpostgre.LIB hbpgsql.LIBWe already have programs to use PostGre in our samples which use some extensions created by FWH already
Is there any further need to create new classes except for academic interest?
Right now we can work with PostGre server.
hi,
yes ,,, but only using (old v9) 32 Bit LibPQ.DLL Interface
i want to use 64 Bit App so i need 64 Bit LibPQ.DLL / LibPQ.LIB
it would be nice if Fivewin 64 Bit Version include "external" 64 Bit LIBs like in 32 bit Version