ODBC API中有bcp功能的一些函数

在msdn上说ODBC API中有bcp功能的一些函数,但是我在编译时却报错
错误信息如下(我已经放入odbc32.lib,odbccp32.lib)
--------------------Configuration: testodbc - Win32 Debug--------------------
Linking...
testodbc.obj : error LNK2001: unresolved external symbol "long __stdcall bcp_done(void *)" (?bcp_done@@YGJPAX@Z)
testodbc.obj : error LNK2001: unresolved external symbol "short __stdcall bcp_sendrow(void *)" (?bcp_sendrow@@YGFPAX@Z)
testodbc.obj : error LNK2001: unresolved external symbol "short __stdcall bcp_bind(void *,unsigned char * const,int,long,unsigned char * const,int,int,int)" (?bcp_bind@@YGFPAXQAEHJ1HHH@Z)
testodbc.obj : error LNK2001: unresolved external symbol "short __stdcall bcp_init(void *,char const *,char const *,char const *,int)" (?bcp_init@@YGFPAXPBD11H@Z)
Debug/testodbc.exe : fatal error LNK1120: 4 unresolved externals
Error executing link.exe.

testodbc.exe - 5 error(s), 0 warning(s)
---------------------------------------------------------------

add links to
odbc32.lib odbcbcp.lib

or add the following two lines in your cpp file:

#pragma comment( lib, "odbc32")
#pragma comment( lib, "odbcbcp")

Published At
Categories with 数据库类
Tagged with
comments powered by Disqus