On Fri, May 5, 2017 at 1:30 AM, Igor Korot <ikorot01@xxxxxxxxx> wrote:
Hi,
[code]
1> Creating library vc_mswuddll\postgres_dll.lib and object
vc_mswuddll\postgres_dll.exp
1>libpqd.lib(fe-connect.obj) : error LNK2019: unresolved external
symbol __imp__WSAIoctl@36 referenced in function _setKeepalivesWin32
1>libpqd.lib(ip.obj) : error LNK2001: unresolved external symbol
__imp__WSAIoctl@36
1>libpqd.lib(fe-connect.obj) : error LNK2019: unresolved external
symbol __imp__DeleteSecurityContext@4 referenced in function
_closePGconn
1>libpqd.lib(fe-connect.obj) : error LNK2019: unresolved external
symbol __imp__FreeCredentialsHandle@4 referenced in function
_closePGconn
1>libpqd.lib(fe-auth.obj) : error LNK2019: unresolved external symbol
_FreeContextBuffer@4 referenced in function _pg_SSPI_continue
1>libpqd.lib(fe-auth.obj) : error LNK2019: unresolved external symbol
_InitializeSecurityContextA@48 referenced in function
_pg_SSPI_continue
1>libpqd.lib(fe-auth.obj) : error LNK2019: unresolved external symbol
_AcquireCredentialsHandleA@36 referenced in function _pg_SSPI_startup
1>libpqd.lib(ip.obj) : error LNK2019: unresolved external symbol
__imp__WSASocketA@24 referenced in function _pg_foreach_ifaddr
1>..\dbhandler\vc_mswuddll\postgres_dll.dll : fatal error LNK1120: 7
unresolved externals
[/code]
And I'm linking with following libraries:
kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;winspool.lib; winmm.lib;shell32.lib;shlwapi. lib;comctl32.lib;ole32.lib; oleaut32.lib;uuid.lib;rpcrt4. lib;advapi32.lib;version.lib; wsock32.lib;wininet.lib;%(
What am I missing? I am linking with wsock32.lib...
I suggest you try building it with the supported method (the msvc build system in src/tools/msvc), and then inspect the difference.
You can also look up those references in the Microsoft docs (for each API function there is a listing at the bottom of the page telling you which header and library is needed). From doing that, AFAICT, you are missing ws2_32.lib and secur32.lib.