LIBhmg-64.a / LibLibPq-64.a

Moderator: Rathinagiri

User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: LIBhmg-64.a / LibLibPq-64.a

Post by danielmaximiliano »

Download and copy folder c:\hmg.3.4.4\LIB-64
liblibpq-64.rar
(34.48 KiB) Downloaded 281 times
rename liblibpq-64.rar to liblibpq-64.a
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: LIBhmg-64.a / LibLibPq-64.a

Post by AUGE_OHR »

danielmaximiliano wrote: Tue Sep 03, 2019 1:14 pm Download and copy folder c:\hmg.3.4.4\LIB-64
liblibpq-64.rar
rename liblibpq-64.rar to liblibpq-64.a
THX for Upload.
sorry to ask again but what about hbpgsql-64 :?:

---

i test with this Code
PGTEST1.ZIP
(2.93 KiB) Downloaded 280 times
and 1st i try 32 Bit with

Code: Select all

libs=LibPq
and it work :!:

than i change to

Code: Select all

libs=LibPq-64
and switch to 64 Bit and press F5

i got Error about PQ* Function and Hint
hbmk2: Hint: Install package hbpgsql and add option 'hbpgsql.hbc' for missing function(s)
i guess i need a 64 Bit Version hbpgsql-64 :?:

i have 32 Bit Version
c:\hmg.3.4.4\HARBOUR\lib\win\mingw\libhbpgsql.a
but under c:\hmg.3.4.4\HARBOUR-64\ or c:\hmg.3.4.4\MinGW-64\ i did not find libhbpgsql-64.a

---

MakeLib.bat seem to create hbpgsql from PostgreSQL 32 Bit LibPG.LIB
who can modify MakeLib.bat for Ming64 to create hbpgsql.64 from 64 Bit LIB
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: LIBhmg-64.a / LibLibPq-64.a

Post by AUGE_OHR »

hi,

as libhbpgsql.a seems to be a harbour Core LIB i guess i have to as there :?:
can someone please point me where to go to ask for Import Lib libhbpgsql-64.a
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: LIBhmg-64.a / LibLibPq-64.a

Post by AUGE_OHR »

sorry me again ...

did someone use LibPQ.DLL 64 Bit Version :?:

to test LibPQ.DLL look here
viewtopic.php?f=12&t=6093

replace

Code: Select all

PeekWord()
with

Code: Select all

Bin2L()
thx to Pcmodula
have fun
Jimmy
User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: LIBhmg-64.a / LibLibPq-64.a

Post by danielmaximiliano »

Libpq.lib and libpq.dll are the libs that are in the 64 bit postgresql installation
C:\Program Files\PostgreSQL\11\lib
the library was converted with the Lib to a recommended by friend Claudio Soto in viewtopic.php?t=4641
2019-09-06 09_02_40-LIB to A Converter v2.0.png
2019-09-06 09_02_40-LIB to A Converter v2.0.png (6.27 KiB) Viewed 7191 times
libpq64.rar
(111.42 KiB) Downloaded 283 times
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: LIBhmg-64.a / LibLibPq-64.a

Post by AUGE_OHR »

hi,

THX so i can make next try

*.DEF file look good so i copy liblibpq.a into c:\hmg.3.4.4\LIB-64\Liblibpq-64.a
start F5 and got

Code: Select all

Harbour 3.2.0dev (r1604201603)
Copyright (c) 1999-2016, http://harbour-project.org/
C:/hmg.3.4.4/mingw-64/bin/../lib/gcc/x86_64-w64-mingw32/5.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/hmg.3.4.4/lib-64\liblibpq-64.a when searching for -llibpq-64
C:/hmg.3.4.4/mingw-64/bin/../lib/gcc/x86_64-w64-mingw32/5.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/hmg.3.4.4/LIB-64\liblibpq-64.a when searching for -llibpq-64
C:/hmg.3.4.4/mingw-64/bin/../lib/gcc/x86_64-w64-mingw32/5.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llibpq-64
collect2.exe: error: ld returned 1 exit status
hbmk2[PGTEST]: Error: Running linker. 1
so i try to convert "my" 64 Bit libpq.dll libpq.lib and it work but i got same Result :?:
before run i found some file in \Convert and they include "32" in Name and i check DLL and it was 32 Bit ... hm

is it possible that Converter work for 32 Bit only :?:

as other have download it too please write if it work in your Environment under 64 Bit, thx
have fun
Jimmy
User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: LIBhmg-64.a / LibLibPq-64.a

Post by danielmaximiliano »

I try to use the 64bit libpq.dll that is included in postgres 64

Code: Select all

#include 'hmg.ch'
REQUEST HB_GT_WIN_DEFAULT

Function Main()

   LOCAL conn, res, aTemp, x, y, pFile
   LOCAL cHost        := "localhost"
   LOCAL cPort        := "5432"
   LOCAL cDb          := "mdidemo"
   LOCAL cUser        := "postgres"
   LOCAL cPass        := "postgres"
   local cPQconnectdb :=""

SetMode(25,80)

   CLS
   conn:= CallDll32( "PQsetdbLogin( cHost, cPort, NIL, NIL, cDb, cUser, cPass )" , "libpq.dll")
   *conn := PQsetdbLogin( cHost, cPort, NIL, NIL, cDb, cUser, cPass )
   ? CallDll32( "PQdb( conn ), PQuser( conn ), PQpass( conn ), PQhost( conn ), PQport( conn ), PQtty( conn ), PQoptions( conn )" , "libpq.dll")
   cPQconnectdb := "host =" + cHost + "port =" + cPort + "dbname =" + cDb + "user =" + cUser + "password =" + cPass
*  conn := PQconnectdb( "dbname = " + cDb + " host = localhost user = " + cUser + " password = " + cPass + " port = 5432" )
   conn := CallDll32( "PQconnectdb(cPQconnectdb)" , "libpq.dll")

   ? CallDll32( "PQstatus( conn ), PQerrorMessage( conn )" , "libpq.dll")
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: LIBhmg-64.a / LibLibPq-64.a

Post by AUGE_OHR »

hi,
danielmaximiliano wrote: Sat Sep 07, 2019 3:50 pm I try to use the 64bit libpq.dll that is included in postgres 64
Thank you for your patience and help

your Sample show me the Way to use CallDll32() so i hope it is like Xbase++

Question : how ist the full Syntax of CallDll32() :?:

---

i have test your Code under 32 / 64 Bit (different PG DLL) but i got NIL :o

Code: Select all

   conn:= CallDll32( "PQsetdbLogin( cHost, cPort, NIL, NIL, cDb, cUser, cPass )" , "libpq.dll")
your Code look like my Xbase++ Code so i wonder why i can't get it run under harbour ... :cry:

Code: Select all

METHOD PGSql:setdbLogin(cHost,cPort,cOpts,cTty, cDbName,cUser,cPwd)
   local lOk

   ::connID := PQsetdbLogin(cHost,cPort,cOpts,cTty, cDbName,cUser,cPwd)
   if !( lOk := (PQstatus(::connID) == 0) )
      ::connID := 0
   endif
return lOk

DLLFUNCTION PQsetdbLogin(c1,c2,c3,c4,c5,c6,c7)  USING STDCALL FROM libpq.dll
DLLFUNCTION PQstatus(o)                         USING STDCALL FROM libpq.dll
both Apps are in same Folder so they use same LibPq.DLL
never less it is my work to find out what is different with calling DLL ...

---

but back to other Way and LibLibPQ-64.a
i still don't know why i can't get it work. LIB2A seems for 32 Bit while "skipping incompatible" :?:
C:/hmg.3.4.4/mingw-64/bin/../lib/gcc/x86_64-w64-mingw32/5.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
skipping incompatible C:/hmg.3.4.4/lib-64\liblibpq-64.a when searching for -llibpq-64

but i got a Step for 64 Bit
"PostgreSQL RDBMS low level (client api) interface code."

Code: Select all

SET HMGPATH=%~dp0%
SET HMGPATH1=%HMGPATH:~0,-13%
SET PATH=C:\hmg.3.4.4\HARBOUR-64\bin;C:\hmg.3.4.4\MinGW-64\bin;%PATH%

c:\hmg.3.4.4\MinGW-64\bin\gcc.exe -c postgres.c -Ic:\hmg.3.4.4\HARBOUR-64\include -Id:\PG\include\
c:\hmg.3.4.4\MinGW-64\bin\gcc.exe -c rddcopy.c -Ic:\hmg.3.4.4\HARBOUR-64\include -Id:\PG\include\
i got 64 Bit Object postgres.o and rddcopy.o
now i have to find you how to build a 64 Bit Lib.a include CLASS TPQServer (tpostgre.prg)
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: LIBhmg-64.a / LibLibPq-64.a

Post by AUGE_OHR »

hi,

have try
c:\hmg.3.4.4\HARBOUR-64\contrib\hbpgsql>

Code: Select all

hbmk2.exe postgres.c rddcopy.c tpostgre.c -Id:\PG\include\ -Ld:\ALASKA\_hrb_dev\HB3\64BIT\LIB -llibpq
File d:\ALASKA\_hrb_dev\HB3\64BIT\LIB\libpq.LIB ist Original from 64 PG-Server v9.5
i got postgres.EXE :o and not a LIB like using TLIB

Code: Select all

  %MG_BCC%\bin\tlib %MV_BUILD%\hbpgsql.lib +postgres.obj +rddcopy.obj +tpostgre.obj
so what to use instead of TLIB when using MING64 :?:
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: LIBhmg-64.a / LibLibPq-64.a

Post by AUGE_OHR »

GOT IT RUN :!:

i had to download 64 Bit Version of
Update für Visual C++ 2013 und Visual C++ Redistributable Package
https://support.microsoft.com/de-de/hel ... le-package
to get rid of "missing MSVCR120.DLL" for 64 Bit :)

i include TEST.PRG with

Code: Select all

PROCEDURE Main()
and compile/link it this Way and it run and display result :D

Code: Select all

harbour.exe TEST.prg -n -w -es2 -gc0 -ic:\hmg.3.4.4\include
hbmk2.exe Test.c postgres.c rddcopy.c tpostgre.c -Id:\PG\include\ -Ld:\ALASKA\_hrb_dev\HB3\64BIT\LIB -llibpq
File d:\ALASKA\_hrb_dev\HB3\64BIT\LIB\libpq.LIB is Original 64 Bit of PG-Server
Attachments
hbpgsql64.ZIP
need 64 Bit DLL
(35.53 KiB) Downloaded 291 times
have fun
Jimmy
Post Reply