Обсуждение: linker
Hi I am new to postgre sql I am trying to execute the sample c code which are connecting to postgre data base
It is postgre web site, I am not bale to compile that code it is generating linker error
Could any body tell how to set lib and dill which are required to exec cute the following is the
Error I am getting
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol _closesocket@4 referenced in function _connectDBStart
libpq.lib(fe-misc.obj) : error LNK2001: unresolved external symbol _closesocket@4
libpq.lib(fe-protocol3.obj) : error LNK2001: unresolved external symbol _closesocket@4
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol _getsockname@12 referenced in function _PQconnectPoll
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol _getsockopt@20 referenced in function _PQconnectPoll
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol _WSAGetLastError@0 referenced in function _PQconnectPoll
libpq.lib(getaddrinfo.obj) : error LNK2001: unresolved external symbol _WSAGetLastError@0
libpq.lib(fe-misc.obj) : error LNK2001: unresolved external symbol _WSAGetLastError@0
libpq.lib(thread.obj) : error LNK2001: unresolved external symbol _WSAGetLastError@0
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol _connect@12 referenced in function _PQconnectPoll
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol _socket@12 referenced in function _PQconnectPoll
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol _ioctlsocket@12 referenced in function _connectMakeNonblocking
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol _setsockopt@20 referenced in function _connectNoDelay
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol _WSASetLastError@4 referenced in function _makeEmptyPGconn
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol _WSAStartup@8 referenced in function _makeEmptyPGconn
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol _recv@16 referenced in function _PQrequestCancel
libpq.lib(fe-secure.obj) : error LNK2001: unresolved external symbol _recv@16
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol _send@16 referenced in function _PQrequestCancel
libpq.lib(fe-secure.obj) : error LNK2001: unresolved external symbol _send@16
libpq.lib(fe-protocol2.obj) : error LNK2001: unresolved external symbol _htonl@4
libpq.lib(fe-protocol3.obj) : error LNK2001: unresolved external symbol _htonl@4
libpq.lib(inet_aton.obj) : error LNK2001: unresolved external symbol _htonl@4
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol _htonl@4 referenced in function _PQrequestCancel
libpq.lib(ip.obj) : error LNK2001: unresolved external symbol _htonl@4
libpq.lib(getaddrinfo.obj) : error LNK2001: unresolved external symbol _htonl@4
libpq.lib(fe-misc.obj) : error LNK2001: unresolved external symbol _htonl@4
libpq.lib(getaddrinfo.obj) : error LNK2019: unresolved external symbol _htons@4 referenced in function _pg_getaddrinfo
libpq.lib(fe-misc.obj) : error LNK2019: unresolved external symbol _htons@4 referenced in function _pqGetc
libpq.lib(getaddrinfo.obj) : error LNK2019: unresolved external symbol _ntohs@4 referenced in function _pg_getnameinfo
libpq.lib(fe-misc.obj) : error LNK2001: unresolved external symbol _ntohs@4
libpq.lib(getaddrinfo.obj) : error LNK2019: unresolved external symbol _inet_ntoa@4 referenced in function _pg_getnameinfo
libpq.lib(fe-misc.obj) : error LNK2019: unresolved external symbol _ntohl@4 referenced in function _pqGetInt
libpq.lib(fe-misc.obj) : error LNK2019: unresolved external symbol _select@20 referenced in function _pqSocketPoll
libpq.lib(thread.obj) : error LNK2019: unresolved external symbol _gethostbyname@4 referenced in function _pqGethostbyname
Debug/a.exe : fatal error LNK1120: 19 unresolved externals
Advance thanks
Regards,
Srinivasa,
On Thu, May 04, 2006 at 06:03:11PM +0530, srinivasa.n wrote: > Hi I am new to postgre sql I am trying to execute the sample c code which > are connecting to postgre data base > > It is postgre web site, I am not bale to compile that code it is generating > linker error > > Could any body tell how to set lib and dill which are required to exec cute > the following is the You don't say which platform you are using, but evidently it's some DOS/Windows related one. You should be using the .DLL, not the .LIB. Have a nice day, -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to litigate.
Вложения
You need to link with wsock32.lib. //Magnus > -----Original Message----- > From: pgsql-general-owner@postgresql.org > [mailto:pgsql-general-owner@postgresql.org] On Behalf Of srinivasa.n > Sent: Thursday, May 04, 2006 2:33 PM > To: pgsql-general@postgresql.org > Subject: [GENERAL] linker > > Hi I am new to postgre sql I am trying to execute the sample > c code which are connecting to postgre data base > > It is postgre web site, I am not bale to compile that code it > is generating linker error > > Could any body tell how to set lib and dill which are > required to exec cute the following is the > > Error I am getting > > > > libpq.lib(fe-connect.obj) : error LNK2019: unresolved > external symbol _closesocket@4 referenced in function _connectDBStart > > libpq.lib(fe-misc.obj) : error LNK2001: unresolved external > symbol _closesocket@4 > > libpq.lib(fe-protocol3.obj) : error LNK2001: unresolved > external symbol _closesocket@4 > > libpq.lib(fe-connect.obj) : error LNK2019: unresolved > external symbol _getsockname@12 referenced in function _PQconnectPoll > > libpq.lib(fe-connect.obj) : error LNK2019: unresolved > external symbol _getsockopt@20 referenced in function _PQconnectPoll > > libpq.lib(fe-connect.obj) : error LNK2019: unresolved > external symbol _WSAGetLastError@0 referenced in function > _PQconnectPoll > > libpq.lib(getaddrinfo.obj) : error LNK2001: unresolved > external symbol _WSAGetLastError@0 > > libpq.lib(fe-misc.obj) : error LNK2001: unresolved external > symbol _WSAGetLastError@0 > > libpq.lib(thread.obj) : error LNK2001: unresolved external > symbol _WSAGetLastError@0 > > libpq.lib(fe-connect.obj) : error LNK2019: unresolved > external symbol _connect@12 referenced in function _PQconnectPoll > > libpq.lib(fe-connect.obj) : error LNK2019: unresolved > external symbol _socket@12 referenced in function _PQconnectPoll > > libpq.lib(fe-connect.obj) : error LNK2019: unresolved > external symbol _ioctlsocket@12 referenced in function > _connectMakeNonblocking > > libpq.lib(fe-connect.obj) : error LNK2019: unresolved > external symbol _setsockopt@20 referenced in function _connectNoDelay > > libpq.lib(fe-connect.obj) : error LNK2019: unresolved > external symbol _WSASetLastError@4 referenced in function > _makeEmptyPGconn > > libpq.lib(fe-connect.obj) : error LNK2019: unresolved > external symbol _WSAStartup@8 referenced in function _makeEmptyPGconn > > libpq.lib(fe-connect.obj) : error LNK2019: unresolved > external symbol _recv@16 referenced in function _PQrequestCancel > > libpq.lib(fe-secure.obj) : error LNK2001: unresolved external > symbol _recv@16 > > libpq.lib(fe-connect.obj) : error LNK2019: unresolved > external symbol _send@16 referenced in function _PQrequestCancel > > libpq.lib(fe-secure.obj) : error LNK2001: unresolved external > symbol _send@16 > > libpq.lib(fe-protocol2.obj) : error LNK2001: unresolved > external symbol _htonl@4 > > libpq.lib(fe-protocol3.obj) : error LNK2001: unresolved > external symbol _htonl@4 > > libpq.lib(inet_aton.obj) : error LNK2001: unresolved external > symbol _htonl@4 > > libpq.lib(fe-connect.obj) : error LNK2019: unresolved > external symbol _htonl@4 referenced in function _PQrequestCancel > > libpq.lib(ip.obj) : error LNK2001: unresolved external symbol _htonl@4 > > libpq.lib(getaddrinfo.obj) : error LNK2001: unresolved > external symbol _htonl@4 > > libpq.lib(fe-misc.obj) : error LNK2001: unresolved external > symbol _htonl@4 > > libpq.lib(getaddrinfo.obj) : error LNK2019: unresolved > external symbol _htons@4 referenced in function _pg_getaddrinfo > > libpq.lib(fe-misc.obj) : error LNK2019: unresolved external > symbol _htons@4 referenced in function _pqGetc > > libpq.lib(getaddrinfo.obj) : error LNK2019: unresolved > external symbol _ntohs@4 referenced in function _pg_getnameinfo > > libpq.lib(fe-misc.obj) : error LNK2001: unresolved external > symbol _ntohs@4 > > libpq.lib(getaddrinfo.obj) : error LNK2019: unresolved > external symbol _inet_ntoa@4 referenced in function _pg_getnameinfo > > libpq.lib(fe-misc.obj) : error LNK2019: unresolved external > symbol _ntohl@4 referenced in function _pqGetInt > > libpq.lib(fe-misc.obj) : error LNK2019: unresolved external > symbol _select@20 referenced in function _pqSocketPoll > > libpq.lib(thread.obj) : error LNK2019: unresolved external > symbol _gethostbyname@4 referenced in function _pqGethostbyname > > Debug/a.exe : fatal error LNK1120: 19 unresolved externals > > > > Advance thanks > > > > Regards, > > > > Srinivasa, > > > > > > > >