Can`t find libpq.dylib lazarus / 16-Databases ---------------------------------------------------------------------- everton · 2012-10-02 12:38 With MacOS X and lazarus 1.1 i`ve added /usr/lib where is libpq.dylib to the $PATH i`ve tried also to link in the app path the libpq.dylib but neither way worked. Anyone knows how to make the PQConnection to work in OS X? ---------------------------------------------------------------------- IndianaJones · 2012-10-02 13:05 what about export DYLD_LIBRARY_PATH= ---------------------------------------------------------------------- everton · 2012-10-02 13:25 Not worked. Still can`t find libpq.dylib wich are in /usr/lib wich are also in the path and the pgAdmin is opening just fine. ---------------------------------------------------------------------- IndianaJones · 2012-10-02 13:26 ok then try otool -L to get the list of the libraries you app is looking for to determine the database dynamic linker name. ---------------------------------------------------------------------- everton · 2012-10-03 10:41 /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 155.0.0)    /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)    /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)    /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)    /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 19.0.0)    /System/Library/Frameworks/Foundation.framework/Versions/C/Foundati on (compatibility version 300.0.0, current version 945.11.0)    /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreSe rvices (compatibility version 1.0.0, current version 57.0.0)    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/Core Foundation (compatibility version 150.0.0, current version 744.12.0)    /System/Library/Frameworks/ApplicationServices.framework/Versions/A /ApplicationServices (compatibility version 1.0.0, current version 45.0.0)    /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1187.34.0) Doesn`t show the libpq. ---------------------------------------------------------------------- everton · 2012-10-03 10:48 I`m using the PQConnection from sqldb. ---------------------------------------------------------------------- everton · 2012-10-03 10:50 It was supposed to show in that the libpq? ---------------------------------------------------------------------- jrmit · 2012-10-03 17:37 Use libpq from pgAdmin.  It's 32 bit, compatible with the version of Lazarus youa're using. ---------------------------------------------------------------------- Phil · 2012-10-03 21:15 Quote from: everton on October 03, 2012, 12:48:36 pmI`m using the PQConnection from sqldb. Looking at the FCL source, it appears as though postgres3dyn.pp calls LoadLibrary to dynamically load the library, using the path "libpq.dylib". I doubt if the file name alone will work with LoadLibrary. See rtl.pdf: "No assumptions should be made about the location of the loaded library if a relative pathname is specified. The behaviour is dependent on the platform. Therefore it is best to specify an absolute pathname if possible." You could try putting a copy of libpq.dylib with your executable under program.app/Contents/MacOS, although even there I would expect a relative path like "./libpq.dylib" to be used, but there doesn't appear to be any way to specify a path short of hacking the FCL source. Possibly this was never tested with OS X. Have you tried Sqlite? That's always installed on all Macs (and iOS devices) and might make a better choice. Not sure if Postgre is included with OS X, although I do see that's installed on my Mac. Thanks. -Phil ---------------------------------------------------------------------- BigChimp · 2012-10-04 07:39 This thread: http://lazarus.freepascal.org/index.php/topic,15286.0.html contains a lot of troubleshooting steps for PostgreSQL... may be worth looking into if you haven't already... ---------------------------------------------------------------------- cpalx · 2012-10-04 13:23 mane a siimbolic link  to libpq.so ---------------------------------------------------------------------- everton · 2012-10-05 11:29 I`ve already tried to put a copy of libpq.dylib in the dir of the app but didn`t work either. ---------------------------------------------------------------------- cpalx · 2012-10-06 11:42 make a simbolic link  or  rename  the libpq.dylib  To libpq.so.that file must be in /usr/lib ---------------------------------------------------------------------- everton · 2012-10-08 11:16 Didn't work either. ---------------------------------------------------------------------- jrmit · 2012-10-08 17:53 Everton - I too struggled with this issue.  This may not be the most elegant solution, but it worked for me. lrwxr-xr-x    1 root  wheel        41 Sep 17 17:59 libpq.5.dylib -> /Library/PostgreSQL/8.4/lib/libpq.5.dylib lrwxr-xr-x    1 root  wheel        13 Sep 18 12:26 libpq.so -> libpq.5.dylib lrwxr-xr-x    1 root  wheel        13 Sep 18 12:33 libpq.dylib -> libpq.5.dylib ---------------------------------------------------------------------- jrmit · 2012-10-09 00:01 otool -L /Library/PostgreSQL/8.4/pgAdmin3.app/Contents/MacOS/pgAdmin3 | grep libpq    @executable_path/../../Contents/Frameworks/libpq.5.dylib (compatibility version 5.0.0, current version 5.2.0)    @executable_path/../../Contents/Frameworks/libpq.5.dylib (compatibility version 5.0.0, current version 5.2.0) {This tells me that version 8.4 uses libpq.5.dylib} {The symlink shown below allowed me to use the libpq.dylib from "pgAdmin3"} 1. cd /Library/PostgreSQL/8.4/pgAdmin3.app/Contents/MacOS/Frameworks 2. sudo ln -s libpq.5.dylib /usr/lib/libpq.dylib ---------------------------------------------------------------------- jrmit · 2012-10-09 00:32 Sorry, made a typo -do not include MacOS in the string.  In step 1 use: cd /Library/PostgreSQL/8.4/pgAdmin3.app/Contents/Frameworks