Operating System - HP-UX
1833052 Members
2477 Online
110049 Solutions
New Discussion

Re: Linker cannot find -lpq while configuring PostGIS installation.

 
SOLVED
Go to solution
sjjung
Occasional Contributor

Linker cannot find -lpq while configuring PostGIS installation.

Hi, I'm trying to install PostGIS 3.2↑ version in my HP-UX ia64 11.31

I have PostgreSQL15.3 installed. And created a symbolic link of the libraries in pgsql/lib inside the $LD_LIBRARY_PATH(/usr/local/lib)

 

# echo $LD_LIBRARY_PATH
/lgems/lib:/lib:/usr/lib:/usr/local/lib

# ls -al /usr/local/lib/hpux64/pgsql | grep libpq
lrwxr-xr-x   1 root       sys             36 Sep  5 13:09 libpq.so -> /usr/local/pgsql/lib/hpux64/libpq.so
lrwxr-xr-x   1 root       sys             47 Sep  5 13:09 libpqwalreceiver.so -> /usr/local/pgsql/lib/hpux64/libpqwalreceiver.so

# ls -al  /usr/local/pgsql/lib/hpux64 | grep libpq
-rw-r--r--   1 root       sys         928574 May 15 20:29 libpq.a
-r-xr-xr-x   1 root       sys         834992 May 15 20:29 libpq.so
lrwxr-xr-x   1 root       sys              8 Aug 10 11:20 libpq.so.5 -> libpq.so
-r-xr-xr-x   1 root       sys          70568 May 15 20:29 libpqwalreceiver.so

 

 

But when I run configure, it fails with the error below.

 

checking for pg_config... /usr/local/pgsql/bin/pg_config
checking PostgreSQL version... PostgreSQL 15.3
checking libpq-fe.h usability... yes
checking libpq-fe.h presence... yes
checking for libpq-fe.h... yes
checking for PQserverVersion in -lpq... no
configure: error: could not find libpq

 

 

and it says in config.log

 

configure:15068: checking for PQserverVersion in -lpq
configure:15093: cc -o conftest +Olibmerrno -O +DD64 -N -I/usr/local/include   -lm conftest.c -lpq  -L/usr/local/pgsql/lib/hpux64 -lpq >&5
"conftest.c", line 43: warning #2111-D: statement is unreachable
    return 0;
    ^

ld: Can't find library for -lpq
Fatal error.

 

 

I'm curious of how I can make the linker find the libpq.

I have tried to change the compiler to gcc, but the same erorr occurred.

Please help.

Thanks in advance.

2 REPLIES 2
sjjung
Occasional Contributor
Solution

Re: Linker cannot find -lpq while configuring PostGIS installation.

I found out that the ld looks for the libraries in /usr/lib directories only. Not LD_LIBRARY_PATH.

Created symbolic liks of the required libraries and solved the problem libpq not found.

Sunitha_Mod
Honored Contributor

Re: Linker cannot find -lpq while configuring PostGIS installation.

Hello @sjjung,

That's excellent! 

We are extremely glad to know the problem has been resolved and we appreciate you for keeping us updated.