Which header and lib files to use when compiling libpq-code?

Поиск
Список
Период
Сортировка
От Kynn Jones
Тема Which header and lib files to use when compiling libpq-code?
Дата
Msg-id c2350ba40904270751p3ddda227l9edd772bb739b0d5@mail.gmail.com
обсуждение исходный текст
Ответы Re: Which header and lib files to use when compiling libpq-code?  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general


I need to compile some code that uses libpq.  For this I need to determine the directories to use for the header and library files.

The machine I'm using has multiple copies of the files libpq-fe.h and libpq.a.  How can I determine which one of all these copies are the ones that correspond to the Pg server that is currently running on this system?  (FWIW, the OS here is Ubuntu Linux.)

I tried the naive approach of using the "newest" versions of these files, as measured by their modification times.  This produced disastrous results.  The code compiled, but resulted in a program that failed in bizarre and unpredictable ways, which strongly hinted at one or more silent segmentation violations in the C code.  I conjectured that this was the result of a mismatched header or library file.  Sure enough, the bizarre failures disappeared when I used a different set of header and library files.

But this method of determining the correct header and library files is still too fraught with uncertainty for my taste.  Is there an approach to this problem that involves less guesswork?

Thanks!

Kynn

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

Предыдущее
От: Richard Broersma
Дата:
Сообщение: Re: PostgreSQL Object-Oriented Database?
Следующее
От: Christophe
Дата:
Сообщение: Re: PostgreSQL Object-Oriented Database?