Thread: Mac OSX 10.6 libpq.5.dylib

Mac OSX 10.6 libpq.5.dylib

From
PANAGIOTIS GERMANIS
Date:
My application builds successfully in Xcode and runs without problems in my mac (running snow leopard 10.6.6) because I have properly installed the postgres 9.0 software.
But when I am trying to run my application in an other mac (that hasn't the postgres installed) I get the following error:

Dyld Error Message:
  Library not loaded: libpq.5.dylib
  Referenced from: /Volumes/Documents/Projects/Mac_Software/iMacProjects/macReport/build/Release/macReport.app/Contents/MacOS/macReport
  Reason: image not found

My application bundle includes libpq.5.dylib into the Frameworks folder.
I faced similar problem with mySQL libraries and resolved them using the following commands in terminal:
install_name_tool -change /usr/local/mysql/lib/libmysqlclient.16.dylib  @executable_path/../Frameworks/libmysqlclient.16.dylib macReport 
install_name_tool -change /usr/local/mysql/lib/libmysqlclient_r.16.dylib  @executable_path/../Frameworks/libmysqlclient_r.16.dylib macReport 

I tryed to do the same with libpq.5.dylib but the problem remains. 

If you have any idea how to solve this error please respond.

THANKS 
___________________________________
Panos Germanis
Software Engineer
mob: 6944339998

"Peace cannot be kept by force. It can only be achieved by understanding."
(Albert Einstein)

Attachment

Re: Mac OSX 10.6 libpq.5.dylib

From
Scott Ribe
Date:
On Feb 19, 2011, at 4:09 AM, PANAGIOTIS GERMANIS wrote:

> Dyld Error Message:
>   Library not loaded: libpq.5.dylib
>   Referenced from:
/Volumes/Documents/Projects/Mac_Software/iMacProjects/macReport/build/Release/macReport.app/Contents/MacOS/macReport
>   Reason: image not found

There are two ways I know of to get that error:

- The dylib is being looked for at the wrong location, which is of course what the install_name_tool command is about.
Youneed to understand what you're actually doing with that command, what the library dependencies actually are and so
on,and make sure you're doing it right. 

- The dylib might be located, but might not contain the correct architecture. You need to make sure you're building a
fatlib that includes all architectures that your app will support. 

--
Scott Ribe
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice