Search Postgresql Archives

Linking against static libpq using Visual C++

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear PostgreSQL community,

When trying to compile c++ code including libpq against the static version libpq.lib, Visual Studio 2010 gives me the following errors:

1>main.obj : error LNK2019: Unresolved external reference "__imp__exit" in Funktion "_main". 1>libpq.lib(fe-connect.obj) : error LNK2001: Unresolved external symbol "__imp__exit". 1>libpq.lib(dirmod.obj) : error LNK2001: Unresolved external symbol "__imp__exit". 1>main.obj : error LNK2019: Unresolved external reference "__imp__fprintf" in Funktion "_main". 1>libpq.lib(dirmod.obj) : error LNK2001: Unresolved external symbol "__imp____iob_func". 1>libpq.lib(win32error.obj) : error LNK2001: Unresolved external symbol "__imp____iob_func". 1>main.obj : error LNK2019: Unresolved external reference "__imp____iob_func" in Funktion "_main". 1>libpq.lib(fe-connect.obj) : error LNK2001: Unresolved external symbol "__imp____iob_func". 1>libpq.lib(encnames.obj) : error LNK2001: Unresolved external symbol "__imp____iob_func". 1>libpq.lib(snprintf.obj) : error LNK2001: Unresolved external symbol "__imp____iob_func". 1>main.obj : error LNK2019: Unresolved external reference "@_RTC_CheckStackVars@8" in Funktion "_main". 1>main.obj : error LNK2019: Unresolved external reference "__RTC_CheckEsp" in Funktion "_main".
1>main.obj : error LNK2001: Unresolved external symbol "__RTC_Shutdown".
1>main.obj : error LNK2001: Unresolved external symbol "__RTC_InitBase".
1>LINK : error LNK2001: Unresolved external symbol "_mainCRTStartup".
1>libpq.lib(md5.obj) : error LNK2019: Unresolved external reference "__imp__free" in Funktion "_pg_md5_hash". 1>libpq.lib(dirent.obj) : error LNK2001: Unresolved external symbol "__imp__free". 1>libpq.lib(fe-protocol3.obj) : error LNK2001: Unresolved external symbol "__imp__free". 1>libpq.lib(fe-auth.obj) : error LNK2001: Unresolved external symbol "__imp__free". 1>libpq.lib(dirmod.obj) : error LNK2001: Unresolved external symbol "__imp__free". 1>libpq.lib(getaddrinfo.obj) : error LNK2001: Unresolved external symbol "__imp__free". 1>libpq.lib(fe-exec.obj) : error LNK2001: Unresolved external symbol "__imp__free". 1>libpq.lib(fe-connect.obj) : error LNK2001: Unresolved external symbol "__imp__free". 1>libpq.lib(pqexpbuffer.obj) : error LNK2001: Unresolved external symbol "__imp__free". 1>libpq.lib(fe-protocol2.obj) : error LNK2001: Unresolved external symbol "__imp__free". 1>libpq.lib(dirmod.obj) : error LNK2001: Unresolved external symbol "__imp__strdup". 1>libpq.lib(fe-exec.obj) : error LNK2019: Unresolved external reference "__imp__strdup" in Funktion "_dupEvents". 1>libpq.lib(fe-connect.obj) : error LNK2001: Unresolved external symbol "__imp__strdup". 1>libpq.lib(fe-protocol3.obj) : error LNK2001: Unresolved external symbol "__imp__strdup". 1>libpq.lib(fe-auth.obj) : error LNK2001: Unresolved external symbol "__imp__strdup". 1>libpq.lib(getaddrinfo.obj) : error LNK2019: Unresolved external reference "__imp__malloc" in Funktion "_pg_getaddrinfo". 1>libpq.lib(md5.obj) : error LNK2001: Unresolved external symbol "__imp__malloc". 1>libpq.lib(dirent.obj) : error LNK2001: Unresolved external symbol "__imp__malloc". 1>libpq.lib(fe-protocol3.obj) : error LNK2001: Unresolved external symbol "__imp__malloc". 1>libpq.lib(pthread-win32.obj) : error LNK2001: Unresolved external symbol "__imp__malloc". 1>libpq.lib(fe-auth.obj) : error LNK2001: Unresolved external symbol "__imp__malloc". 1>libpq.lib(dirmod.obj) : error LNK2001: Unresolved external symbol "__imp__malloc". 1>libpq.lib(fe-exec.obj) : error LNK2001: Unresolved external symbol "__imp__malloc". 1>libpq.lib(fe-connect.obj) : error LNK2001: Unresolved external symbol "__imp__malloc". 1>libpq.lib(pqexpbuffer.obj) : error LNK2001: Unresolved external symbol "__imp__malloc". 1>libpq.lib(fe-protocol2.obj) : error LNK2001: Unresolved external symbol "__imp__malloc". 1>libpq.lib(fe-exec.obj) : error LNK2019: Unresolved external reference "__imp__realloc" in Funktion "_pqAddTuple". 1>libpq.lib(pqexpbuffer.obj) : error LNK2001: Unresolved external symbol "__imp__realloc". 1>libpq.lib(fe-misc.obj) : error LNK2001: Unresolved external symbol "__imp__realloc". 1>libpq.lib(dirmod.obj) : error LNK2001: Unresolved external symbol "__imp__realloc". 1>libpq.lib(fe-exec.obj) : error LNK2019: Unresolved external reference "__imp__sscanf" in Funktion "_pqSaveParameterStatus". 1>libpq.lib(fe-exec.obj) : error LNK2019: Unresolved external reference "__imp__strncpy" in Funktion "_PQoidStatus". 1>libpq.lib(fe-protocol2.obj) : error LNK2001: Unresolved external symbol "__imp__strncpy". 1>libpq.lib(fe-protocol3.obj) : error LNK2001: Unresolved external symbol "__imp__strncpy". 1>libpq.lib(fe-exec.obj) : error LNK2019: Unresolved external reference "__imp__strspn" in Funktion "_PQoidStatus". 1>libpq.lib(fe-exec.obj) : error LNK2019: Unresolved external reference "__imp__strncmp" in Funktion "_PQoidStatus". 1>libpq.lib(fe-connect.obj) : error LNK2001: Unresolved external symbol "__imp__strncmp". 1>libpq.lib(fe-protocol2.obj) : error LNK2001: Unresolved external symbol "__imp__strncmp". 1>libpq.lib(fe-exec.obj) : error LNK2019: Unresolved external reference "__imp__strtoul" in Funktion "_PQoidValue". 1>libpq.lib(dirmod.obj) : error LNK2001: Unresolved external symbol "___security_cookie". 1>libpq.lib(getaddrinfo.obj) : error LNK2001: Unresolved external symbol "___security_cookie". 1>libpq.lib(md5.obj) : error LNK2001: Unresolved external symbol "___security_cookie". 1>libpq.lib(dirent.obj) : error LNK2001: Unresolved external symbol "___security_cookie". 1>libpq.lib(fe-misc.obj) : error LNK2001: Unresolved external symbol "___security_cookie". 1>libpq.lib(fe-protocol2.obj) : error LNK2001: Unresolved external symbol "___security_cookie". 1>libpq.lib(ip.obj) : error LNK2001: Unresolved external symbol "___security_cookie". 1>libpq.lib(fe-auth.obj) : error LNK2001: Unresolved external symbol "___security_cookie". 1>libpq.lib(fe-exec.obj) : error LNK2019: Unresolved external reference "___security_cookie" in Funktion "_pqInternalNotice". 1>libpq.lib(fe-connect.obj) : error LNK2001: Unresolved external symbol "___security_cookie". 1>libpq.lib(encnames.obj) : error LNK2001: Unresolved external symbol "___security_cookie". 1>libpq.lib(snprintf.obj) : error LNK2001: Unresolved external symbol "___security_cookie". 1>libpq.lib(dirmod.obj) : error LNK2001: Unresolved external symbol "@__security_check_cookie@4". 1>libpq.lib(getaddrinfo.obj) : error LNK2001: Unresolved external symbol "@__security_check_cookie@4". 1>libpq.lib(md5.obj) : error LNK2001: Unresolved external symbol "@__security_check_cookie@4". 1>libpq.lib(dirent.obj) : error LNK2001: Unresolved external symbol "@__security_check_cookie@4". 1>libpq.lib(fe-misc.obj) : error LNK2001: Unresolved external symbol "@__security_check_cookie@4". 1>libpq.lib(fe-protocol2.obj) : error LNK2001: Unresolved external symbol "@__security_check_cookie@4". 1>libpq.lib(ip.obj) : error LNK2001: Unresolved external symbol "@__security_check_cookie@4". 1>libpq.lib(fe-auth.obj) : error LNK2001: Unresolved external symbol "@__security_check_cookie@4". 1>libpq.lib(fe-exec.obj) : error LNK2019: Unresolved external reference "@__security_check_cookie@4" in Funktion "_pqInternalNotice". 1>libpq.lib(fe-connect.obj) : error LNK2001: Unresolved external symbol "@__security_check_cookie@4". 1>libpq.lib(encnames.obj) : error LNK2001: Unresolved external symbol "@__security_check_cookie@4". 1>libpq.lib(snprintf.obj) : error LNK2001: Unresolved external symbol "@__security_check_cookie@4". 1>libpq.lib(fe-exec.obj) : error LNK2019: Unresolved external reference "__imp__isdigit" in Funktion "_PQcmdTuples". 1>libpq.lib(inet_aton.obj) : error LNK2001: Unresolved external symbol "__imp__isdigit". 1>libpq.lib(fe-protocol2.obj) : error LNK2001: Unresolved external symbol "_memcpy". 1>libpq.lib(fe-protocol3.obj) : error LNK2001: Unresolved external symbol "_memcpy". 1>libpq.lib(getaddrinfo.obj) : error LNK2001: Unresolved external symbol "_memcpy".
1>libpq.lib(md5.obj) : error LNK2001: Unresolved external symbol "_memcpy".
1>libpq.lib(fe-exec.obj) : error LNK2019: Unresolved external reference "_memcpy" in Funktion "_PQsetResultAttrs". 1>libpq.lib(fe-connect.obj) : error LNK2001: Unresolved external symbol "_memcpy". 1>libpq.lib(pqexpbuffer.obj) : error LNK2001: Unresolved external symbol "_memcpy". 1>libpq.lib(fe-misc.obj) : error LNK2001: Unresolved external symbol "_memcpy". 1>libpq.lib(fe-protocol3.obj) : error LNK2001: Unresolved external symbol "_memset".
1>libpq.lib(md5.obj) : error LNK2001: Unresolved external symbol "_memset".
1>libpq.lib(fe-exec.obj) : error LNK2019: Unresolved external reference "_memset" in Funktion "_PQsetvalue". 1>libpq.lib(fe-connect.obj) : error LNK2001: Unresolved external symbol "_memset". 1>libpq.lib(snprintf.obj) : error LNK2001: Unresolved external symbol "_memset". 1>libpq.lib(fe-protocol2.obj) : error LNK2001: Unresolved external symbol "_memset". 1>libpq.lib(fe-connect.obj) : error LNK2019: Unresolved external reference "__imp___time64" in Funktion "_time". 1>libpq.lib(fe-misc.obj) : error LNK2001: Unresolved external symbol "__imp___time64". 1>libpq.lib(fe-connect.obj) : error LNK2019: Unresolved external reference "__imp__DeleteSecurityContext@4" in Funktion "_closePGconn". 1>libpq.lib(fe-connect.obj) : error LNK2019: Unresolved external reference "__imp__FreeCredentialsHandle@4" in Funktion "_closePGconn". 1>libpq.lib(fe-connect.obj) : error LNK2019: Unresolved external reference "__imp__strncat" in Funktion "_internal_cancel". 1>libpq.lib(fe-connect.obj) : error LNK2019: Unresolved external reference "__imp__fflush" in Funktion "_PQuntrace". 1>libpq.lib(fe-misc.obj) : error LNK2001: Unresolved external symbol "__imp__fflush". 1>libpq.lib(fe-connect.obj) : error LNK2019: Unresolved external reference "__imp__fclose" in Funktion "_parseServiceInfo". 1>libpq.lib(fe-connect.obj) : error LNK2019: Unresolved external reference "__imp__strchr" in Funktion "_parseServiceInfo". 1>libpq.lib(fe-protocol2.obj) : error LNK2001: Unresolved external symbol "__imp__strchr". 1>libpq.lib(dirmod.obj) : error LNK2001: Unresolved external symbol "__imp__strchr". 1>libpq.lib(fe-connect.obj) : error LNK2019: Unresolved external reference "__imp__isspace" in Funktion "_parseServiceInfo". 1>libpq.lib(fe-protocol2.obj) : error LNK2001: Unresolved external symbol "__imp__isspace". 1>libpq.lib(inet_aton.obj) : error LNK2001: Unresolved external symbol "__imp__isspace". 1>libpq.lib(fe-connect.obj) : error LNK2019: Unresolved external reference "__imp__fgets" in Funktion "_parseServiceInfo". 1>libpq.lib(fe-connect.obj) : error LNK2019: Unresolved external reference "__imp__fopen" in Funktion "_parseServiceInfo". 1>libpq.lib(fe-connect.obj) : error LNK2019: Unresolved external reference "__imp__getenv" in Funktion "_parseServiceInfo". 1>libpq.lib(fe-misc.obj) : error LNK2001: Unresolved external symbol "__imp__getenv". 1>libpq.lib(fe-protocol2.obj) : error LNK2001: Unresolved external symbol "__imp__getenv". 1>libpq.lib(fe-protocol3.obj) : error LNK2001: Unresolved external symbol "__imp__getenv". 1>libpq.lib(fe-connect.obj) : error LNK2019: Unresolved external reference "__imp__ferror" in Funktion "_PasswordFromFile". 1>libpq.lib(fe-connect.obj) : error LNK2019: Unresolved external reference "__imp__feof" in Funktion "_PasswordFromFile". 1>libpq.lib(fe-connect.obj) : error LNK2019: Unresolved external reference "__imp__isalpha" in Funktion "_PasswordFromFile". 1>libpq.lib(fe-connect.obj) : error LNK2019: Unresolved external reference "__imp__atoi" in Funktion "_connectDBStart". 1>libpq.lib(fe-protocol3.obj) : error LNK2001: Unresolved external symbol "__imp__atoi". 1>libpq.lib(getaddrinfo.obj) : error LNK2001: Unresolved external symbol "__imp__atoi". 1>libpq.lib(encnames.obj) : error LNK2019: Unresolved external reference "__imp__isalnum" in Funktion "_clean_encoding_name". 1>libpq.lib(snprintf.obj) : error LNK2019: Unresolved external reference "__imp__fwrite" in Funktion "_flushbuffer". 1>libpq.lib(snprintf.obj) : error LNK2019: Unresolved external reference "__imp__memmove" in Funktion "_dostr". 1>libpq.lib(fe-misc.obj) : error LNK2001: Unresolved external symbol "__imp__memmove". 1>libpq.lib(snprintf.obj) : error LNK2019: Unresolved external reference "__imp__sprintf" in Funktion "_fmtptr". 1>libpq.lib(snprintf.obj) : error LNK2019: Unresolved external reference "__aulldvrm" in Funktion "_fmtint". 1>libpq.lib(snprintf.obj) : error LNK2001: Unresolved external symbol "__fltused". 1>libpq.lib(snprintf.obj) : error LNK2019: Unresolved external reference "__imp___errno" in Funktion "_pg_vsnprintf". 1>libpq.lib(dirmod.obj) : error LNK2001: Unresolved external symbol "__imp___errno". 1>libpq.lib(win32error.obj) : error LNK2001: Unresolved external symbol "__imp___errno". 1>libpq.lib(dirent.obj) : error LNK2001: Unresolved external symbol "__imp___errno". 1>libpq.lib(fe-misc.obj) : error LNK2019: Unresolved external reference "__imp__fputc" in Funktion "_fputnbytes". 1>libpq.lib(fe-protocol2.obj) : error LNK2019: Unresolved external reference "__imp__strstr" in Funktion "_pqGetErrorNotice2". 1>libpq.lib(pgstrcasecmp.obj) : error LNK2019: Unresolved external reference "__imp__tolower" in Funktion "_pg_strcasecmp". 1>libpq.lib(pgstrcasecmp.obj) : error LNK2019: Unresolved external reference "__imp__isupper" in Funktion "_pg_strcasecmp". 1>libpq.lib(pgstrcasecmp.obj) : error LNK2019: Unresolved external reference "__imp__toupper" in Funktion "_pg_toupper". 1>libpq.lib(pgstrcasecmp.obj) : error LNK2019: Unresolved external reference "__imp__islower" in Funktion "_pg_toupper". 1>libpq.lib(inet_aton.obj) : error LNK2001: Unresolved external symbol "__imp__islower". 1>libpq.lib(ip.obj) : error LNK2019: Unresolved external reference "__imp__strtol" in Funktion "_pg_sockaddr_cidr_mask". 1>libpq.lib(fe-auth.obj) : error LNK2019: Unresolved external reference "_FreeContextBuffer@4" in Funktion "_pg_SSPI_continue". 1>libpq.lib(fe-auth.obj) : error LNK2019: Unresolved external reference "_InitializeSecurityContextA@48" in Funktion "_pg_SSPI_continue". 1>libpq.lib(fe-auth.obj) : error LNK2019: Unresolved external reference "_AcquireCredentialsHandleA@36" in Funktion "_pg_SSPI_startup". 1>libpq.lib(dirmod.obj) : error LNK2019: Unresolved external reference "__imp___stat64i32" in Funktion "_stat". 1>libpq.lib(dirmod.obj) : error LNK2019: Unresolved external reference "__imp__unlink" in Funktion "_pgunlink". 1>libpq.lib(dirmod.obj) : error LNK2019: Unresolved external reference "__imp__strerror" in Funktion "_pgfnames". 1>libpq.lib(thread.obj) : error LNK2001: Unresolved external symbol "__imp__strerror". 1>libpq.lib(dirmod.obj) : error LNK2019: Unresolved external reference "__imp__rmdir" in Funktion "_rmtree". 1>libpq.lib(inet_aton.obj) : error LNK2019: Unresolved external reference "__imp__isxdigit" in Funktion "_inet_aton". 1>C:\Users\Julia\Documents\Visual Studio 2010\Projects\pg_con\Debug\pg_con.exe : fatal error LNK1120: 59 Unresolved external references.

I've built my libpq.lib with Visual Studio and added the include directories and libraries of PostgreSQL to the additional dependencies of my visual studio project, but there still seem to be missing libraries.
How can I find out which libraries I need to add?

Regards,
Julia


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux