Re: Cannot Statically Link libpq.a

Поиск
Список
Период
Сортировка
От Emilio Recio
Тема Re: Cannot Statically Link libpq.a
Дата
Msg-id 3D91C0C8.7050900@storm.jmc.tju.edu
обсуждение исходный текст
Ответ на Cannot Statically Link libpq.a  (Emilio Recio <erecio@storm.jmc.tju.edu>)
Список pgsql-interfaces
Patrick Welche wrote:
> Very long shot: what if you move the -lpq to the end?
> 
> gcc -o testpq -static testpq.c -lpq

YOU ROCK!

erecio@datacollector1:$ make
gcc -static -o testpg -L. testpg.o -lpq
./libpq.a(fe-auth.o): In function `pg_password_sendauth':
fe-auth.o(.text+0x148): undefined reference to `crypt'
collect2: ld returned 1 exit status
make: *** [pgconn] Error 1

-- after editing the makefile

$ make
gcc -static -o testpg -L. testpg.o -lpq -lcrypt
strip testpg && size testpg   text    data     bss     dec     hex filename 437341   11488  165800  614629   960e5
pgconn

$ ldd testpg        not a dynamic executable

I've been away from C for too long... QT has pampered me and PHP has 
made me lazy. Java well... has made me take everything for granted. :) 
Hopefully this list is archived so someone else doesn't make that same 
'oops'. Thanks a lot.

~Elmo



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

Предыдущее
От: Emilio Recio
Дата:
Сообщение: Re: Cannot Statically Link libpq.a
Следующее
От: "William West"
Дата:
Сообщение: Meaning of/ handling of ECPG_NOTICE_* ??