Skip site navigation (1) Skip section navigation (2)

Libpq linker error

From: Daniel Gerardo Lucero Baylon <daniel_baylon(at)yahoo(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Libpq linker error
Date: 2004-02-11 15:46:04
Message-ID: 20040211154604.41382.qmail@web41204.mail.yahoo.com (view raw or flat)
Thread:
Lists: 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(at)4 referenced in function _connectDBStart
libpq.lib(fe-misc.obj) : error LNK2001: unresolved external symbol
_closesocket(at)4
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol
_connect(at)12 referenced in function _connectDBStart
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol
_WSAGetLastError(at)0 referenced in function _connectDBStart
libpq.lib(fe-misc.obj) : error LNK2001: unresolved external symbol
_WSAGetLastError(at)0
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol
_socket(at)12 referenced in function _connectDBStart
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol _htons(at)4
referenced in function _connectDBStart
libpq.lib(fe-misc.obj) : error LNK2001: unresolved external symbol _htons(at)4
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol
_gethostbyname(at)4 referenced in function _connectDBStart
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol
_inet_addr(at)4 referenced in function _inet_aton
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol
_ioctlsocket(at)12 referenced in function _connectMakeNonblocking
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol
_setsockopt(at)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(at)4
referenced in function _PQconnectPoll
libpq.lib(fe-misc.obj) : error LNK2001: unresolved external symbol _htonl(at)4
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol
_getsockname(at)12 referenced in function _PQconnectPoll
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol
_getsockopt(at)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(at)16
referenced in function _PQrequestCancel
libpq.lib(fe-secure.obj) : error LNK2001: unresolved external symbol _send(at)16
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol
_WSASetLastError(at)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(at)8 referenced in function _fe_getauthname
libpq.lib(fe-secure.obj) : error LNK2019: unresolved external symbol _recv(at)16
referenced in function _pqsecure_read
libpq.lib(fe-misc.obj) : error LNK2019: unresolved external symbol _ntohl(at)4
referenced in function _pqGetInt
libpq.lib(fe-misc.obj) : error LNK2019: unresolved external symbol _ntohs(at)4
referenced in function _pqGetInt
libpq.lib(fe-misc.obj) : error LNK2019: unresolved external symbol
___WSAFDIsSet(at)8 referenced in function _pqReadReady
libpq.lib(fe-misc.obj) : error LNK2019: unresolved external symbol _select(at)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

Responses

pgsql-interfaces by date

Next:From: Jeroen T. VermeulenDate: 2004-02-11 16:29:58
Subject: Re: Libpq linker error
Previous:From: kwiles81Date: 2004-02-11 14:59:14
Subject: Can not connect with pgin.tcl

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group