Re: LIBhmg-64.a / LibLibPq-64.a
Posted: Tue Sep 03, 2019 1:14 pm
Download and copy folder c:\hmg.3.4.4\LIB-64
rename liblibpq-64.rar to liblibpq-64.aExclusive forum for HMG, a Free / Open Source xBase WIN32/64 Bits / GUI Development System
http://mail.hmgforum.com/
THX for Upload.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
Code: Select all
libs=LibPq
Code: Select all
libs=LibPq-64
i guess i need a 64 Bit Version hbpgsql-64hbmk2: Hint: Install package hbpgsql and add option 'hbpgsql.hbc' for missing function(s)
but under c:\hmg.3.4.4\HARBOUR-64\ or c:\hmg.3.4.4\MinGW-64\ i did not find libhbpgsql-64.ac:\hmg.3.4.4\HARBOUR\lib\win\mingw\libhbpgsql.a
Code: Select all
PeekWord()
Code: Select all
Bin2L()
the library was converted with the Lib to a recommended by friend Claudio Soto in viewtopic.php?t=4641C:\Program Files\PostgreSQL\11\lib
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
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")
Thank you for your patience and helpdanielmaximiliano wrote: ↑Sat Sep 07, 2019 3:50 pm I try to use the 64bit libpq.dll that is included in postgres 64
Code: Select all
conn:= CallDll32( "PQsetdbLogin( cHost, cPort, NIL, NIL, cDb, cUser, cPass )" , "libpq.dll")
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
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
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\
Code: Select all
hbmk2.exe postgres.c rddcopy.c tpostgre.c -Id:\PG\include\ -Ld:\ALASKA\_hrb_dev\HB3\64BIT\LIB -llibpq
Code: Select all
%MG_BCC%\bin\tlib %MV_BUILD%\hbpgsql.lib +postgres.obj +rddcopy.obj +tpostgre.obj
https://support.microsoft.com/de-de/hel ... le-packageUpdate für Visual C++ 2013 und Visual C++ Redistributable Package
Code: Select all
PROCEDURE Main()
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