Libpq linker error - Mailing list pgsql-interfaces

From Daniel Gerardo Lucero Baylon
Subject Libpq linker error
Date
Msg-id 20040211154604.41382.qmail@web41204.mail.yahoo.com
Whole thread Raw
Responses Re: Libpq linker error
List pgsql-interfaces
I compiled PostgreSQL 7.3.4 libpq for Win 32 using VC++ 7 compiler.

Compiler generates a libpq.lib file. Build a simple C program which opens and
closes a database connection.

When try to link object program and libpq library, following error occurs:

ibpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol
__imp__strdup referenced in function _PQconnectStart
libpq.lib(fe-exec.obj) : error LNK2019: unresolved external symbol
__imp__strdup referenced in function _PQfn
OLDNAMES.lib(strdup.obi) : error LNK2001: unresolved external symbol
__imp__strdup
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol
__imp__getenv referenced in function _PQsetdbLogin
libpq.lib(fe-misc.obj) : error LNK2001: unresolved external symbol
__imp__getenv
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-connect.obj) : error LNK2019: unresolved external symbol
_connect@12 referenced in function _connectDBStart
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol
_WSAGetLastError@0 referenced in function _connectDBStart
libpq.lib(fe-misc.obj) : error LNK2001: unresolved external symbol
_WSAGetLastError@0
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol
_socket@12 referenced in function _connectDBStart
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol _htons@4
referenced in function _connectDBStart
libpq.lib(fe-misc.obj) : error LNK2001: unresolved external symbol _htons@4
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol
_gethostbyname@4 referenced in function _connectDBStart
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol
_inet_addr@4 referenced in function _inet_aton
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
__imp__time referenced in function _connectDBComplete
libpq.lib(fe-misc.obj) : error LNK2001: unresolved external symbol __imp__time
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol _htonl@4
referenced in function _PQconnectPoll
libpq.lib(fe-misc.obj) : error LNK2001: unresolved external symbol _htonl@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
__imp__sprintf referenced in function _PQsetenvPoll
libpq.lib(fe-exec.obj) : error LNK2001: unresolved external symbol
__imp__sprintf
libpq.lib(win32.obj) : error LNK2001: unresolved external symbol __imp__sprintf
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol
__imp__stricmp referenced in function _PQsetenvPoll
OLDNAMES.lib(stricmp.obi) : error LNK2001: unresolved external symbol
__imp__stricmp
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-connect.obj) : error LNK2019: unresolved external symbol
_WSASetLastError@4 referenced in function _PQrequestCancel
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol
__imp__isspace referenced in function _conninfo_parse
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol
__imp__strtok referenced in function _parseServiceInfo
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol
__imp__strncmp referenced in function _parseServiceInfo
libpq.lib(fe-exec.obj) : error LNK2001: unresolved external symbol
__imp__strncmp
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol
__imp__fgets referenced in function _parseServiceInfo
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol
__imp__fopen referenced in function _parseServiceInfo
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol
__imp__fprintf referenced in function _defaultNoticeProcessor
libpq.lib(fe-misc.obj) : error LNK2001: unresolved external symbol
__imp__fprintf
libpq.lib(encnames.obj) : error LNK2001: unresolved external symbol
__imp__fprintf
libpq.lib(dllist.obj) : error LNK2001: unresolved external symbol
__imp__fprintf
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol
__imp__stat referenced in function _PasswordFromFile
OLDNAMES.lib(stat.obi) : error LNK2001: unresolved external symbol __imp__stat
libpq.lib(fe-exec.obj) : error LNK2019: unresolved external symbol
__imp__sscanf referenced in function _PQunescapeBytea
libpq.lib(fe-exec.obj) : error LNK2019: unresolved external symbol
__imp__isdigit referenced in function _PQunescapeBytea
libpq.lib(fe-exec.obj) : error LNK2019: unresolved external symbol
__imp___snprintf referenced in function _parseInput
libpq.lib(fe-auth.obj) : error LNK2001: unresolved external symbol
__imp___snprintf
libpq.lib(fe-misc.obj) : error LNK2001: unresolved external symbol
__imp___snprintf
libpq.lib(fe-exec.obj) : error LNK2019: unresolved external symbol
__imp__tolower referenced in function _PQfnumber
libpq.lib(fe-exec.obj) : error LNK2019: unresolved external symbol
__imp__isupper referenced in function _PQfnumber
libpq.lib(fe-exec.obj) : error LNK2019: unresolved external symbol
__imp__strspn referenced in function _PQoidStatus
libpq.lib(fe-exec.obj) : error LNK2019: unresolved external symbol
__imp___errno referenced in function _PQoidValue
libpq.lib(fe-exec.obj) : error LNK2019: unresolved external symbol
__imp__strtoul referenced in function _PQoidValue
libpq.lib(pqexpbuffer.obj) : error LNK2019: unresolved external symbol
__imp___vsnprintf referenced in function _printfPQExpBuffer
libpq.lib(fe-auth.obj) : error LNK2019: unresolved external symbol
__imp__perror referenced in function _pg_password_sendauth
libpq.lib(fe-auth.obj) : error LNK2019: unresolved external symbol
__imp__GetUserNameA@8 referenced in function _fe_getauthname
libpq.lib(fe-secure.obj) : error LNK2019: unresolved external symbol _recv@16
referenced in function _pqsecure_read
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 _ntohs@4
referenced in function _pqGetInt
libpq.lib(fe-misc.obj) : error LNK2019: unresolved external symbol
___WSAFDIsSet@8 referenced in function _pqReadReady
libpq.lib(fe-misc.obj) : error LNK2019: unresolved external symbol _select@20
referenced in function _pqReadReady
libpq.lib(encnames.obj) : error LNK2019: unresolved external symbol
__imp__isalnum referenced in function _clean_encoding_name
OLDNAMES.lib(strdup.obi) : error LNK2001: unresolved external symbol
__imp___strdup
OLDNAMES.lib(stricmp.obi) : error LNK2001: unresolved external symbol
__imp___stricmp
OLDNAMES.lib(stat.obi) : error LNK2001: unresolved external symbol __imp___stat
example.exe : fatal error LNK1120: 46 unresolved externals

I don't know if additional postgre libraries are missing.

I appreciate some help.

Best Regards.

__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html


pgsql-interfaces by date:

Previous
From: "Marc G. Fournier"
Date:
Subject: Re: Need new project admin for unbundled Tcl interface
Next
From: "Jeroen T. Vermeulen"
Date:
Subject: Re: Libpq linker error