On Tue, Sep 9, 2008 at 2:02 AM, Darren Weber <darren.weber.lists@xxxxxxxxx> wrote: > I'm new to using PostgreSQL on mac OS X. I used a binary installer > for PostgreSQL 8.3 on mac OS X 10.5, which installs into > > /Library/PostgreSQL/[version]/.... > > I'm building a lot of software that links to libpq and most of the > builds fail or the run-time fails, because it cannot find the > PostgreSQL libraries by default. It seems the dynamic link loader > doesn't search this path by default to locate dynamic libraries, like > libpq.5.dylib. > > Can you fix this issue for the binary installer? Hmm, it seems this is a side-effect of not rewriting the shared library paths at installation time. Because the library ID is just the filename, the linker doesn't write the full path to the binaries you compile. We changed from the old behaviour after it became apparent that the utilities we needed to rewrite the paths are on available on machines with XCode installed. I would suggest doing one of the following: sudo ln -s /Library/PostgreSQL/8.3/lib/libpq.5.dylib /usr/lib/libpq.5.dylib which will put a symlink to the library in /usr/lib, where the dynamic loader will find it, or: export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/Library/PostgreSQL/8.3/lib" which will tell the dynamic linker to look in the PG lib directory. A third possible fix would be to use install_name_tool to rewrite the shared library path in the executable you've built. I'll look at a solution for the installer - it'll probably have to be the symlink unless anyone else has a better idea... -- Dave Page EnterpriseDB UK: http://www.enterprisedb.com