POSTGREQL Problem

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

POSTGREQL Problem

Post by sudip »

Hi All,

I am trying to compile my first Postgresql project. But, found following errors during compilation.

Code: Select all

c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1b): undefined reference to `PQfinish'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x10a): undefined reference to `PQconnectdb'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x22d): undefined reference to `PQsetdbLogin'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x2a4): undefined reference to `PQfinish'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x2f8): undefined reference to `PQreset'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x338): undefined reference to `PQprotocolVersion'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x388): undefined reference to `PQclientEncoding'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x3e6): undefined reference to `PQsetClientEncoding'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x438): undefined reference to `PQdb'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x488): undefined reference to `PQuser'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x4d8): undefined reference to `PQpass'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x528): undefined reference to `PQhost'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x578): undefined reference to `PQport'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x5c8): undefined reference to `PQtty'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x618): undefined reference to `PQoptions'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x657): undefined reference to `PQclear'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x6b3): undefined reference to `PQexec'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x7c1): undefined reference to `PQexecParams'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x833): undefined reference to `PQresultStatus'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x840): undefined reference to `PQnfields'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x893): undefined reference to `PQresultStatus'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x8a0): undefined reference to `PQntuples'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x8f2): undefined reference to `PQresultStatus'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x925): undefined reference to `PQgetisnull'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x939): undefined reference to `PQgetvalue'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x992): undefined reference to `PQresultStatus'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x9c3): undefined reference to `PQgetlength'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0xa14): undefined reference to `PQresultStatus'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0xa52): undefined reference to `PQnfields'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0xa7a): undefined reference to `PQftype'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0xa88): undefined reference to `PQfmod'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0xb2e): undefined reference to `PQfname'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0xb9a): undefined reference to `PQftable'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0xbc0): undefined reference to `PQftablecol'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0xe95): undefined reference to `PQresultStatus'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0xec2): undefined reference to `PQntuples'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0xece): undefined reference to `PQnfields'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0xf41): undefined reference to `PQgetvalue'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0xfc8): undefined reference to `PQtransactionStatus'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1018): undefined reference to `PQerrorMessage'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1068): undefined reference to `PQstatus'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x10a7): undefined reference to `PQresultErrorMessage'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x10e7): undefined reference to `PQresultStatus'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1127): undefined reference to `PQcmdStatus'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1167): undefined reference to `PQcmdTuples'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x11c1): undefined reference to `PQescapeString'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1216): undefined reference to `PQescapeBytea'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1228): undefined reference to `PQfreemem'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x125c): undefined reference to `PQunescapeBytea'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1276): undefined reference to `PQfreemem'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x12a7): undefined reference to `PQoidValue'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x12e7): undefined reference to `PQoidStatus'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1327): undefined reference to `PQbinaryTuples'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1376): undefined reference to `PQftable'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x13c6): undefined reference to `PQftype'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1416): undefined reference to `PQfname'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1466): undefined reference to `PQfmod'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x14b6): undefined reference to `PQfsize'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1527): undefined reference to `PQgetisnull'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1575): undefined reference to `PQfnumber'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x15b7): undefined reference to `PQntuples'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x15f7): undefined reference to `PQnfields'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1663): undefined reference to `PQsendQuery'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x16b8): undefined reference to `PQgetResult'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1714): undefined reference to `PQconsumeInput'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1774): undefined reference to `PQisBusy'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x17d4): undefined reference to `PQrequestCancel'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1828): undefined reference to `PQflush'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1886): undefined reference to `PQsetnonblocking'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x18d8): undefined reference to `PQisnonblocking'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1958): undefined reference to `PQuntrace'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x19a6): undefined reference to `PQsetErrorVerbosity'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1a13): undefined reference to `lo_import'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1aa7): undefined reference to `lo_export'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1b25): undefined reference to `lo_unlink'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1b78): undefined reference to `PQserverVersion'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1bc8): undefined reference to `PQgetCancel'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1c44): undefined reference to `PQcancel'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1c97): undefined reference to `PQfreeCancel'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1cfa): undefined reference to `PQescapeByteaConn'
c:\hmg\Harbour\lib/libhbpgsql.a(postgres.o):postgres.c:(.text+0x1d0c): undefined reference to `PQfreemem'
mingw32-make.exe: *** [D:\HMGProjects\HMGPgsql\DEMO.exe] Error 1
Finished With Errors. 
I found LIBPQ.DLL in the bin folder of Postgresql installation folder, but don't know how to create library. Can anyone help me?

Thanks in advance.

With best regards.

Sudip
With best regards,
Sudip
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: POSTGREQL Problem

Post by Rathinagiri »

From DLL you can create libpq.a using dlltool.

http://oldwiki.mingw.org/index.php/Crea ... tLibraries

I think this would help you. I wish you to win ASAP connecting with another DB. ;)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: POSTGREQL Problem

Post by sudip »

rathinagiri wrote:From DLL you can create libpq.a using dlltool.

http://oldwiki.mingw.org/index.php/Crea ... tLibraries

I think this would help you. I wish you to win ASAP connecting with another DB. ;)
Thanks a lot Rathi. But I can't find dlltool in Mingw folder within HMG folder. From where shall I download it?
And also thank you for your wishes about my new experiment with Postgresql. :)
With best regards.
Sudip
With best regards,
Sudip
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: POSTGREQL Problem

Post by Rathinagiri »

http://www.gnu.org/software/binutils/

or

https://sourceforge.net/projects/mingw/ ... z/download

would work for you.

Otherwise, just download dlltool.zip and uncompress from here. ;)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: POSTGREQL Problem

Post by sudip »

Thank you Rathi.
I downloaded it. Did as per the documentation. But, it created a file LIBPQ.A of size 0 byte!!! ;)
BTW, have you used Postgresql with HMG?
I must say that, it's (PGSql) admin tool is very nice (reminds me MS SQLSERVER). And it is not as slow, as I read from some posts in different groups :)
With best regards.
Sudip
With best regards,
Sudip
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: POSTGREQL Problem

Post by Rathinagiri »

Sudip, I had created libpq.a for you from my versions of libpq.dll and dlltool.exe

Verify and give your comments. I am eager to know about the results.
libpq.zip
(6.49 KiB) Downloaded 425 times
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: POSTGREQL Problem

Post by sudip »

Thanks a lot Rathi for libpq.a.
Now I can compile but it doesn't run :(

It shows a message:
pgsql.jpg
pgsql.jpg (11.97 KiB) Viewed 7380 times
But, I can't find MySql reference within my prg file:
Demo.zip
(3.48 KiB) Downloaded 396 times
Moreover I found some interesting old discussion about PGsql in this forum viewtopic.php?f=5&t=116

With best regards.

Sudip
With best regards,
Sudip
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: POSTGREQL Problem

Post by Rathinagiri »

Libmysql.dll? Interesting. :)

For me it says (null).dll.

I don't know what to do!
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: POSTGREQL Problem

Post by sudip »

rathinagiri wrote:Libmysql.dll? Interesting. :)
For me it says (null).dll.
Yes, because you have MySql installed in your computer :)
I got the same error message (null).dll when I copied LibMySql.dll into PGSql project folder for testing :lol:
There may be some errors within harbour pgsql library (if I am not wrong) :?

BTW, Apais once you told me about Postgresql (viewtopic.php?f=5&t=294&start=8). Have you used Postgresql with HMG?

IMHO, we shall wait for latest Harbour installation.

Master Roberto, please suggest :)

With best regards.

Sudip
With best regards,
Sudip
User avatar
apais
Posts: 441
Joined: Fri Aug 01, 2008 6:03 pm
DBs Used: DBF, Leto, MariaDB, SQLite
Location: uruguay
Contact:

Re: POSTGREQL Problem

Post by apais »

Hi SUDIP

I haven't used postgresql with hmg yet sorry.

Regards
Angel
Angel Pais
Web Apps consultant/architect/developer.
Post Reply