Re: Linking against static libpq using Visual C++

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: Linking against static libpq using Visual C++
Дата
Msg-id AANLkTinkMfDAXVqcP6_8_TB9KWD10+MskueP+c3=XZ6G@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Linking against static libpq using Visual C++  (Julia Jacobson <julia.jacobson@arcor.de>)
Ответы Re: Linking against static libpq using Visual C++
Re: Linking against static libpq using Visual C++
Список pgsql-general
On Sun, Feb 27, 2011 at 18:01, Julia Jacobson <julia.jacobson@arcor.de> wrote:
> Thanks for your answer. I was indeed using the static libpq version from the
> installer.
> I tried to compile my own one with Visual Studio 2010, but this caused a lot
> of problems due to the fact that Visual Studio 2010 has changed the manifest
> tool.
> So I built a static version using Visual C++ 2008, which worked without
> problems.
> However, when building my application with Visual C++ 2008, the following
> errors are lamented:
>
> 1>libpq.lib(fe-connect.obj) : error LNK2019: Unresolved external reference
> "__imp__WSAIoctl@36" in Funktion "_setKeepalivesWin32".
> 1>libpq.lib(ip.obj) : error LNK2001: Unvresolved external symbol
> "__imp__WSAIoctl@36".
> 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(ip.obj) : error LNK2019: Unresolved external reference
> "__imp__WSASocketA@24" in Funktion "_pg_foreach_ifaddr".
> 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>C:\Users\Julia\Desktop\db_con\Debug\db_con.exe : fatal error LNK1120: 7
> Unresolved external references.
>
> Which libraries are missing now?

At least one of those is winsock, thus probably wsock2_32 or something
like that. The SSPI stuff is from some other system library, don't
know offhand which. You can look up the missing function in the MSDN
documentation, it should list which .lib is needed to access it.

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

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

Предыдущее
От: Julia Jacobson
Дата:
Сообщение: Re: Linking against static libpq using Visual C++
Следующее
От: Daniele Varrazzo
Дата:
Сообщение: Binary params in libpq