Re: errors when making examples in /src/test/examples

Поиск
Список
Период
Сортировка
От Jeremy Buchmann
Тема Re: errors when making examples in /src/test/examples
Дата
Msg-id 3CF6371A.7030004@wellsgaming.com
обсуждение исходный текст
Ответ на errors when making examples in /src/test/examples  (Wei Wang <Wei.Wang@cl.cam.ac.uk>)
Ответы Re: errors when making examples in /src/test/examples
Список pgsql-interfaces
Wei Wang wrote:
> Hi,
> 
> Afte searching on the net, I added -lpq but the result is not positive:
> 
> gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -I../../../src/interfaces/libpq -I../../../src/include
testlibpq.c  -o testlibpq -lpq
 
> testlibpq.c: In function `exit_nicely':
> testlibpq.c:14: warning: implicit declaration of function `exit'
> /usr/bin/ld: cannot find -lpq
> collect2: ld returned 1 exit status
> 
> What am I missing here?

You need to tell gcc where to find libpq.so.  You do that with the -L 
option.  So find libpq.so (I don't know where it is in the compile tree) 
and then add -L/path/to/libpq to the command.

So you might end up with something like:

gcc -I../../../src/interfaces/libpq -I../../../src/include 
-L../../../src/lib testlibpq.c -o testlibpq -lpq

Again, I don't really know where libpq.so is, so find it and substitute 
the real path for the one above.

--Jeremy






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

Предыдущее
От: Wei Wang
Дата:
Сообщение: errors when making examples in /src/test/examples
Следующее
От: Wei Wang
Дата:
Сообщение: Re: errors when making examples in /src/test/examples