libpq.a and Xcode on Mac OS X

Поиск
Список
Период
Сортировка
От Peter K. Stys
Тема libpq.a and Xcode on Mac OS X
Дата
Msg-id 8B50CB22-C969-494B-9341-B570513C2638@ohri.ca
обсуждение исходный текст
Ответы Re: libpq.a and Xcode on Mac OS X  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: libpq.a and Xcode on Mac OS X  (John DeSoi <desoi@pgedit.com>)
Список pgsql-interfaces
Hi Folks:

In an attempt to optimize retrieving BLOBs from my PostgreSQL DB I embarked on a mission to write functions in C to directly access the back-end using the libpq.a library.

I copied libpq.a from my /usr/local/pgsql/lib/libpq.a installation into my Xcode project, added all necessary includes and the standard libpq-fe.h header.  My test program builds and runs fine, links against libpq.a no problem, but upon execution of a simple:

conn = PQconnectdb(conninfo); 

(taken from the Postgres examples) the debugger stops in asm code (presumably the library) with the error:

0x90047960  <+0000>  li      r0,37
0x90047964  <+0004>  sc      
0x90047968  <+0008>  b       0x90047970 <kill+16>
0x9004796c  <+0012>  blr
...

Cannot access memory at address 0x0.

I'm using Xcode 2.4 on Mac OS X 10.4.8.

Do you have any ideas or does someone have a simple Xcode project that would show me how to properly use libpq.a directly from a C program?  Is there an OS X-specific site with examples I could browse through?


Any advice greatly appreciated.  I'm stuck very early in my attempts!

thanks,
Peter.


------------------------------------------------------------------------------- 
Peter K. Stys, MD
Professor of Medicine(Neurology), Senior Scientist
Ottawa Health Research Institute, Div. of Neuroscience 
Ottawa Hospital / University of Ottawa  
Ontario, CANADA 
tel:    (613)761-5444
fax:    (613)761-5330 
-------------------------------------------------------------------------------



Confidentiality Statement - The contents of this e-mail, including its attachment, are intended for the exclusive use of the recipient and may contain confidential or privileged information.  If you are not the intended recipient, you are strictly prohibited from reading, using, disclosing, copying, or distributing this e-mail or any of its contents.  If you received this e-mail in error, please notify the sender by reply e-mail immediately or the Privacy Office (privacy@ottawahospital.on.ca ) and permanently delete this e-mail and its attachments, along with any copies thereof.  Thank you.

 

Avis de confidentialité – Ce courriel, y compris ses pièces jointes, s’adresse au destinataire uniquement et pourrait contenir des renseignements confidentiels. Si vous n’êtes pas le bon destinataire, il est strictement interdit de lire, d’utiliser, de divulguer, de copier ou de diffuser ce courriel ou son contenu, en partie ou en entier. Si vous avez reçu ce courriel par erreur, veuillez en informer immédiatement l’expéditeur ou le bureau de la Protection des renseignements personnels (info.privee@hopitalottawa.on.ca), puis effacez le courriel ainsi que les pièces jointes et toute autre copie. Merci.


В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: postgres 8.1.8 transaction ID wrapper around related problem
Следующее
От: "Chris Long"
Дата:
Сообщение: ruby-postgres for Ruby 1.9