- 论坛徽章:
- 0
|
怎样在windows下编译libpq库
一个客户端程序.动态连接库可以.静态连接库出错.(libpq.lib)
--------------------Configuration: testlibpq - Win32 Debug--------------------
Linking...
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _free already defined in LIBCD.lib(dbgheap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _memmove already defined in LIBCD.lib(memmove.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _strncpy already defined in LIBCD.lib(strncpy.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _sprintf already defined in LIBCD.lib(sprintf.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _malloc already defined in LIBCD.lib(dbgheap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __isctype already defined in LIBCD.lib(isctype.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fclose already defined in LIBCD.lib(fclose.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fflush already defined in LIBCD.lib(fflush.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fprintf already defined in LIBCD.lib(fprintf.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _realloc already defined in LIBCD.lib(dbgheap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __snprintf already defined in LIBCD.lib(snprintf.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __vsnprintf already defined in LIBCD.lib(vsnprint.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _exit already defined in LIBCD.lib(crt0dat.obj)
LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library
libpq.lib(fe-connect.obj) : error LNK2001: unresolved external symbol _closesocket@4
libpq.lib(fe-misc.obj) : error LNK2001: unresolved external symbol _closesocket@4
libpq.lib(fe-connect.obj) : error LNK2001: unresolved external symbol _connect@12
libpq.lib(fe-connect.obj) : error LNK2001: unresolved external symbol _WSAGetLastError@0
libpq.lib(fe-misc.obj) : error LNK2001: unresolved external symbol _WSAGetLastError@0
libpq.lib(fe-connect.obj) : error LNK2001: unresolved external symbol _socket@12
libpq.lib(fe-connect.obj) : error LNK2001: unresolved external symbol _htons@4
libpq.lib(fe-misc.obj) : error LNK2001: unresolved external symbol _htons@4
libpq.lib(fe-connect.obj) : error LNK2001: unresolved external symbol _gethostbyname@4
libpq.lib(fe-connect.obj) : error LNK2001: unresolved external symbol _inet_addr@4
libpq.lib(fe-connect.obj) : error LNK2001: unresolved external symbol _ioctlsocket@12
libpq.lib(fe-connect.obj) : error LNK2001: unresolved external symbol _setsockopt@20
libpq.lib(fe-connect.obj) : error LNK2001: unresolved external symbol _htonl@4
libpq.lib(fe-misc.obj) : error LNK2001: unresolved external symbol _htonl@4
libpq.lib(fe-connect.obj) : error LNK2001: unresolved external symbol _getsockname@12
libpq.lib(fe-connect.obj) : error LNK2001: unresolved external symbol _getsockopt@20
libpq.lib(fe-connect.obj) : error LNK2001: unresolved external symbol _send@16
libpq.lib(fe-secure.obj) : error LNK2001: unresolved external symbol _send@16
libpq.lib(fe-connect.obj) : error LNK2001: unresolved external symbol _WSASetLastError@4
libpq.lib(fe-secure.obj) : error LNK2001: unresolved external symbol _recv@16
libpq.lib(fe-misc.obj) : error LNK2001: unresolved external symbol _ntohs@4
libpq.lib(fe-misc.obj) : error LNK2001: unresolved external symbol _ntohl@4
libpq.lib(fe-misc.obj) : error LNK2001: unresolved external symbol ___WSAFDIsSet@8
libpq.lib(fe-misc.obj) : error LNK2001: unresolved external symbol _select@20
Debug/testlibpq.exe : fatal error LNK1120: 19 unresolved externals
Error executing link.exe.
testlibpq.exe - 38 error(s), 1 warning(s)
在加上一个wsock32.lib,出错信息如下:
--------------------Configuration: testlibpq - Win32 Debug--------------------
Linking...
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _free already defined in LIBCD.lib(dbgheap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _memmove already defined in LIBCD.lib(memmove.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _strncpy already defined in LIBCD.lib(strncpy.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _sprintf already defined in LIBCD.lib(sprintf.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _malloc already defined in LIBCD.lib(dbgheap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __isctype already defined in LIBCD.lib(isctype.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fclose already defined in LIBCD.lib(fclose.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fflush already defined in LIBCD.lib(fflush.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fprintf already defined in LIBCD.lib(fprintf.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _realloc already defined in LIBCD.lib(dbgheap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __snprintf already defined in LIBCD.lib(snprintf.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __vsnprintf already defined in LIBCD.lib(vsnprint.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _exit already defined in LIBCD.lib(crt0dat.obj)
LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library
Debug/testlibpq.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
testlibpq.exe - 14 error(s), 1 warning(s)
请高手指点. |
|