build Import LIB from LibPQ.DLL
build Import LIB from LibPQ.DLL
hi,
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
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
greeting,
Jimmy
Jimmy
- nageswaragunupudi
- Posts: 10691
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: build Import LIB from LibPQ.DLL
May not be the latest versions, but these libs and dll might work as well
Also please see fwh\samples\buildh.bat to see the usage.
Code: Select all | Expand
fwh\lib\hppgsql.lib
fwh\lib\libpq.lib
and
fwh\samples\libpq.dll
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: build Import LIB from LibPQ.DLL
hi,
thx for Answer.
File c:\fwh64\samples\libpq.dll are Version v9.6.3 and 32 Bit (!) and there is no fwh64\lib\libpq.lib
for HMG i have build a Lib "a" (MinGW) for LibPQ.DLL 64 Bit ... but i don´t remember how ...
---
hm ... CLASS TPQSERVER have some Source
c:\hmg.3.4.4\1\hbpgsql\hbpgsql.hbc
c:\hmg.3.4.4\1\hbpgsql\hbpgsql.hbp
this was my *.BAT
c:\hmg.3.4.4\1\hbpgsql\build.log
thx for Answer.
File c:\fwh64\samples\libpq.dll are Version v9.6.3 and 32 Bit (!) and there is no fwh64\lib\libpq.lib
for HMG i have build a Lib "a" (MinGW) for LibPQ.DLL 64 Bit ... but i don´t remember how ...
---
hm ... CLASS TPQSERVER have some Source
Code: Select all | Expand
c:\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.prg
Code: Select all | Expand
description=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
Code: Select all | Expand
-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.prg
Code: Select all | Expand
rem 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-64
what do i need to change for BCC / MSVC to use with Fivewin 64 Bithbmk2: Dependency 'hbpgsql' found: d:\PG\9.5\include
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
greeting,
Jimmy
Jimmy
- Antonio Linares
- Site Admin
- Posts: 42268
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: build Import LIB from LibPQ.DLL
Dear Jimmy,
You can use implib.exe to easily create them for both Borland and MSVC, 32 and 64 bits
You can use implib.exe to easily create them for both Borland and MSVC, 32 and 64 bits
Re: build Import LIB from LibPQ.DLL
hi Antonio,
how is the Syntax
x:\>C:\BCC7\bin\implib.exe libpq.dl
how is the Syntax
x:\>C:\BCC7\bin\implib.exe libpq.dl
! Note : i have LibPQ.DLL (32/64 Bit) and want to build a "Import" LIB to use it with FivewinEmbarcadero Implib Version 3.3.0 Copyright (c) 1991-2014 Embarcadero Technologies, Inc.
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
greeting,
Jimmy
Jimmy
- Antonio Linares
- Site Admin
- Posts: 42268
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: build Import LIB from LibPQ.DLL
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
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
- nageswaragunupudi
- Posts: 10691
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: build Import LIB from LibPQ.DLL
FWH comes bundled with
In addition you also need all the dlls in
fwh\dll\postgre\*.dll
all these dlls are also available in fwh\samples folder.
fwh\samples\buildh.bat includes the link script for these libs.
In other words,. a new user to FWH can effortlessly build a postgre application, without downloading anything and building any implibs on his own just by
if he wants to build a working postre 32-bit application using (x)Harbour and bcc.
Once done, then we can go to 64bits in the next step.
For this you need to download and use all 64-bit dlls, build 64bit implib and also build Harbour's hbpgsql.lib in 64 bits.
Quick start can be made just using what FWH offers and just using buildh.bat in practically no time.
Code: Select all | Expand
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.dll
fwh\dll\postgre\*.dll
all these dlls are also available in fwh\samples folder.
fwh\samples\buildh.bat includes the link script for these libs.
In other words,. a new user to FWH can effortlessly build a postgre application, without downloading anything and building any implibs on his own just by
Code: Select all | Expand
buildh mypostgreapp
Once done, then we can go to 64bits in the next step.
For this you need to download and use all 64-bit dlls, build 64bit implib and also build Harbour's hbpgsql.lib in 64 bits.
Quick start can be made just using what FWH offers and just using buildh.bat in practically no time.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- nageswaragunupudi
- Posts: 10691
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: build Import LIB from LibPQ.DLL
If 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.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: build Import LIB from LibPQ.DLL
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
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
greeting,
Jimmy
Jimmy
- Antonio Linares
- Site Admin
- Posts: 42268
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: build Import LIB from LibPQ.DLL
> Not sure how the dependency is defined
ok, I found how to define it:
-depkeyhead=test:libmariadb64.dll
-depcontrol=test:yes
-depimplibs=test:libmariadb64.dll
-depincpath=test:.
ok, I found how to define it:
-depkeyhead=test:libmariadb64.dll
-depcontrol=test:yes
-depimplibs=test:libmariadb64.dll
-depincpath=test:.
hbmk2: Dependency 'test' found: .
Creating library libmariadb64.lib and object libmariadb64.exp
hbmk2: Created import library: libmariadb64.lib <= libmariadb64.dll
Re: build Import LIB from LibPQ.DLL
hi,
it seems i made a Mistake to use *.HBC while using *,MAK (BCC) or *.HBP (MSVC)
under HMG I was used to work with *.HBC, where I had Libs=
but when i use BCC and *.MAK it "seems" not to work
after include in *.MAK
32 Bit App using BCC work now
---
libpq.lib"seem" me the "Original" by PostgreSQL 32 / 64 Bit so my Question was wrong
i need to build a 64 Bit Version of hbpgsql.lib for Fivewin using these Files:
it seems i made a Mistake to use *.HBC while using *,MAK (BCC) or *.HBP (MSVC)
under HMG I was used to work with *.HBC, where I had Libs=
but when i use BCC and *.MAK it "seems" not to work
after include in *.MAK
Code: Select all | Expand
echo c:\fwh\lib\hbpgsql.lib + >> b32.bc
echo c:\fwh\lib\libpq.lib + >> b32.bc
---
libpq.lib"seem" me the "Original" by PostgreSQL 32 / 64 Bit so my Question was wrong
i need to build a 64 Bit Version of hbpgsql.lib for Fivewin using these Files:
i know to use buildh.bat ti build EXE but how to build 64 Bit LIB for MSVCtpostgre.prg
postgres.c
rddcopy.c
greeting,
Jimmy
Jimmy
- Antonio Linares
- Site Admin
- Posts: 42268
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: build Import LIB from LibPQ.DLL
Dear Jimmy,
Use hbmk2.exe and -hblib in the hbp file, and the files names
Use hbmk2.exe and -hblib in the hbp file, and the files names
Re: build Import LIB from LibPQ.DLL
hi Antonio,
it compile/link now without Problem, under 64 Bit using MSVC, and i got to 1st Step to show "Catalog"
---
to build hbpgsql.LIB your need LibPQ.LIB from PostgreSQL Server and also some *.h
copy LibPQ.LIB into c:\fwh64\lib\
hbpgsql.hbP
hbpgsql.hbc
MakeFWLIB.BAT
last line ist to "rename" LIB ... how to chagene "output" Lib Name
copy hbpgsql.LIB into c:\fwh64\lib\
i will make a Sample how to use CLASS TPQServer
YES, that seems to workAntonio Linares wrote:Use hbmk2.exe and -hblib in the hbp file, and the files names
it compile/link now without Problem, under 64 Bit using MSVC, and i got to 1st Step to show "Catalog"
---
to build hbpgsql.LIB your need LibPQ.LIB from PostgreSQL Server and also some *.h
copy LibPQ.LIB into c:\fwh64\lib\
hbpgsql.hbP
Code: Select all | Expand
-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.rc
Code: Select all | Expand
description=PostgreSQL wrapper (SQL)
incpaths=.
headers=postgres.ch
libs=${_HB_DYNPREF}${hb_name}${_HB_DYNSUFF}
{unix}libs=pq
{!unix}libs=libpq
Code: Select all | Expand
call "%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.LIB
copy hbpgsql.LIB into c:\fwh64\lib\
i will make a Sample how to use CLASS TPQServer
greeting,
Jimmy
Jimmy
- nageswaragunupudi
- Posts: 10691
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: build Import LIB from LibPQ.DLL
We 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.
Is there any further need to create new classes except for academic interest?
Right now we can work with PostGre server.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: build Import LIB from LibPQ.DLL
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
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
greeting,
Jimmy
Jimmy