Re: [GENERAL] C & C ++Program Problem

Поиск
Список
Период
Сортировка
От Doug McNaught
Тема Re: [GENERAL] C & C ++Program Problem
Дата
Msg-id m3y9ekb6m9.fsf@varsoon.wireboard.com
обсуждение исходный текст
Ответ на Re: C & C ++Program Problem  (Arindam Haldar <arindamhaldar@hotpop.com>)
Список pgsql-interfaces
Arindam Haldar <arindamhaldar@hotpop.com> writes:

> on my RedHat 7.2 i have inserted these lines in the file /etc/ld.so.conf
> /usr/lib/pgsql-7.2

This may or may not be necessary, but if you do it you need to run
'ldconfig' in order for it to take effect.

> using gcc -lpq egtry.c gives error-->
> /usr/bin/ld: cannot find -lpq
> collect2: ld reurned 1 exit status

You need to add a -L flag to the compile so gcc looks in the right
place for libraries.  Also, the '-lpq' should go *after* your source
file name.  So:

gcc -o egtry egtry.c -L/usr/lib/pgsql-7.2 -lpq

That should get you a lot closer to working.

-Doug

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

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: [GENERAL] C & C ++Program Problem
Следующее
От: "Nigel J. Andrews"
Дата:
Сообщение: libpgtcl - backend version information patch