I think this is the problem,
libpq.so.4 => /usr/lib/libpq.so.4
If you have PG installed in /u01/... why you link against library in
/usr/lib?
also, 8.2.x libpq is .5 already, not .4
Bernd Eidenschink wrote:
>> Ah well, we found some new bugs anyway...
>
> Apropos :-)
>
> I have plenty of bugs that break down to (my) human failure in fact, here's
> another... My best friend is the compiling-the-postgres-driver-situation.
> Vlad knows, he often helps me with that but it's a neverending story.
>
> The base of the problem is we always compile Postgres from source and have no
> default installation directories.
>
> Example:
> Naviserver in /usr/local/nsroot_production
> Postgres in /u01/pgsql8.2.4-dev
>
> Say I checkout the modules/nsdbpg and try to compile, giving only the
> NAVISERVER variable:
>
> gmake NAVISERVER=/usr/local/nsroot_production/
> gcc -pipe -O2 -fomit-frame-pointer -Wall -Wno-implicit-int -fPIC -pipe
> -I/usr/local/nsroot_production//include
> -I"/usr/local/nsroot_production/include" -DHAVE_CONFIG_H -c -o
> nsdbpg.o nsdbpg.c
> In file included from nsdbpg.c:37:
> dbpg.h:44:22: error: libpq-fe.h: No such file or directory
> In file included from nsdbpg.c:37:
> dbpg.h:52: error: expected specifier-qualifier-list before ‘PGconn’
> [... lots of errors following]
>
> I try to be more specific:
> gmake NAVISERVER=/usr/local/nsroot_production \
> CFLAGS="-I/u01/pgsql8.2.4-dev/lib \
> -I/u01/pgsql8.2.4-dev/include \
> -I/usr/local/nsroot_staging/include"
>
> (Some warnings, but finally:)
> gcc -pipe -shared -nostartfiles -L/usr/local/nsroot_production/lib -o
> nsdbpg.so nsdbpg.o
> tclcmds.o -lnsdb -lpq -lnsthread -lnsd -L/usr/local/nsroot_production/lib
> -ltcl8.4 -ldl -lgcc_s -lieee -lm -Wl,--export-dynamic
> -L/usr/local/nsroot_production/lib -Wl,-rpath,/usr/local/nsroot_production/lib
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../../i586-suse-linux/bin/ld: cannot
> find -lpq
> collect2: ld returned 1 exit status
> make: *** [nsdbpg.so] Error 1
>
> So, after trying various things, I edited the Makefile and changed the line:
> MODLIBS = -lnsdb -lpq
>
> to
> MODLIBS
> = -L/usr/local/nsroot_production/include/nsdb.h
> -L/u01/pgsql8.2.4-dev/lib/libpq.a
> (or)
> = -lnsdb -L/u01/pgsql8.2.4-dev/lib/libpq.a
>
>
> and hey! that does it - theres the nsdbpg.so
>
> But:
> ldd nsdbpg.so
> linux-gate.so.1 =>
> libnsdb.so => /usr/local/nsroot_production/lib/libnsdb.so
> libnsthread.so => /usr/local/nsroot_production/lib/libnsthread.so
> libnsd.so => /usr/local/nsroot_production/lib/libnsd.so
> libtcl8.4.so => /usr/local/nsroot_production/lib/libtcl8.4.so
> libdl.so.2 => /lib/libdl.so.2
> libgcc_s.so.1 => /lib/libgcc_s.so.1
> libm.so.6 => /lib/libm.so.6
> libc.so.6 => /lib/libc.so.6
> libz.so.1 => /lib/libz.so.1
> libcrypt.so.1 => /lib/libcrypt.so.1
> libpthread.so.0 => /lib/libpthread.so.0
> /lib/ld-linux.so.2
>
> This one does not work (" undefined symbol: PQsetdbLogin"), because of libpq
> et. al. missing.
>
> If I compare it with this working driver (and I simpy can't tell anymore
> what
> I made different with that one):
> (ignore the "not found" messages as I don't set the LD_LIBRARY_PATH, but this
> driver works then):
> linux-gate.so.1 =>
> libnsdb.so => not found
> libpq.so.4 => /usr/lib/libpq.so.4
> libnsthread.so => not found
> libnsd.so => not found
> libtcl8.4.so => /usr/lib/libtcl8.4.so
> libdl.so.2 => /lib/libdl.so.2
> libcrypt.so.1 => /lib/libcrypt.so.1
> libz.so.1 => /lib/libz.so.1
> libgcc_s.so.1 => /lib/libgcc_s.so.1
> libm.so.6 => /lib/libm.so.6
> libc.so.6 => /lib/libc.so.6
> libssl.so.0.9.8 => /usr/lib/libssl.so.0.9.8
> libcrypto.so.0.9.8 => /usr/lib/libcrypto.so.0.9.8
> libkrb5.so.3 => /usr/lib/libkrb5.so.3
> libresolv.so.2 => /lib/libresolv.so.2
> libnsl.so.1 => /lib/libnsl.so.1
> libpthread.so.0 => /lib/libpthread.so.0
> /lib/ld-linux.so.2
> libk5crypto.so.3 => /usr/lib/libk5crypto.so.3
> libcom_err.so.2 => /lib/libcom_err.so.2
> libkrb5support.so.0 => /usr/lib/libkrb5support.so.0
>
> Maybe it's something really simple to change? Something obvious?
>
> Bernd.
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> naviserver-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/naviserver-devel
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
naviserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/naviserver-devel