Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2014-06

Win32 postgres unit compilation error

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Allan E. Registos

Hi,

I have found out that the postgres unit in Lazarus(I have tested with 1.2.0 and 1.2.4 versions) will cause compilation errors on Windows, but will work fine in Linux.

Errors:

Error: Import library not found for pq

Error: Import library not found for c

Error: Undefined symbol: _PQsetdbLogin

Is this a known issue? I am trying to use the postgres unit to talk directly to the pg server.

Thanks,

Allan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140619/68de9f94/attachment.html>

Reply by email

Péter Gábor
to Allan E. Registos

This issue is no way related to FPC or Lazarus. External software libraries are not distributed with FPC/Lazarus except if they are needed to run.
You must have libpq.dll and libc.dll (or libcrypt.dll if you modify the source of postgres units) installed on your windows system on a path where your software can fin it!
The _PQsetdbLogin symbol is undefined because the related libraries ain't loaded.

On your Linux these libraries are already installed.

2014-06-19 07:45 keltez?ssel, Allan E. Registos ?rta:

Show quoted text 9 lines
I have found out that the postgres unit in Lazarus(I have tested with 1.2.0 and 1.2.4 versions) will cause compilation errors on Windows, but will work fine in Linux. Errors: Error: Import library not found for pq Error: Import library not found for c Error: Undefined symbol: _PQsetdbLogin Is this a known issue? I am trying to use the postgres unit to talk directly to the pg server.
P?ter G?bor

Reply by email

Péter Gábor
to Allan E. Registos: I have found out that the postgres unit in Lazarus(I have tested with 1.2.0 and 1.2.4…

If the libraries are installed on your windows, maybe you try static linking... DLL files cannot be statically linked.

Show quoted text 21 lines
This issue is no way related to FPC or Lazarus. External software libraries are not distributed with FPC/Lazarus except if they are > needed to run. You must have libpq.dll and libc.dll (or libcrypt.dll if you modify the source of postgres units) installed on your windows system on a path where your software can fin it! The _PQsetdbLogin symbol is undefined because the related libraries ain't loaded. On your Linux these libraries are already installed. 2014-06-19 07:45 keltez?ssel, Allan E. Registos ?rta: > I have found out that the postgres unit in Lazarus(I have tested with > 1.2.0 and 1.2.4 versions) will cause compilation errors on Windows, but > will work fine in Linux. > Errors: > Error: Import library not found for pq > Error: Import library not found for c > Error: Undefined symbol: _PQsetdbLogin > Is this a known issue? I am trying to use the postgres unit to talk > directly to the pg server.
P?ter G?bor

Reply by email