- 论坛徽章:
- 89
|
本帖最后由 fender0107401 于 2014-12-17 21:04 编辑
回复 9# action08
问个问题,使用OTL的时候,需要链接什么库吗,我在尝试连MySQL。- #include <iostream>
- using namespace std;
- #include <stdio.h>
- #define OTL_ODBC_MYSQL
- #define OTL_UNICODE
- #include "otlv4.h"
- otl_connect db;
- int main()
- {
- otl_connect::otl_initialize();
- return 0;
- }
复制代码 报错如下:
1>main.obj : error LNK2001: unresolved external symbol __fltused
1>main.obj : error LNK2019: unresolved external symbol "extern "C" double __cdecl _hypot(double,double)" (?_hypot@@$$J0YANNN@Z) referenced in function "extern "C" double __cdecl hypot(double,double)" (?hypot@@$$J0YANNN@Z)
1>main.obj : error LNK2019: unresolved external symbol "void __cdecl __ExceptionPtrCopy(void *,void const *)" (?__ExceptionPtrCopy@@$$FYAXPAXPBX@Z) referenced in function "public: __thiscall std::exception_ptr::exception_ptr(class std::exception_ptr const &)" (??0exception_ptr@std@@$$FQAE@ABV01@@Z)
1>main.obj : error LNK2019: unresolved external symbol "extern "C" void * __cdecl memcpy(void *,void const *,unsigned int)" (?memcpy@@$$J0YAPAXPAXPBXI@Z) referenced in function "public: static char * __cdecl std::char_traits<char>::copy(char *,char const *,unsigned int)" (?copy@?$char_traits@D@std@@$$FSAPADPADPBDI@Z)
1>main.obj : error LNK2019: unresolved external symbol "extern "C" void * __cdecl memmove(void *,void const *,unsigned int)" (?memmove@@$$J0YAPAXPAXPBXI@Z) referenced in function "public: static char * __cdecl std::char_traits<char>::move(char *,char const *,unsigned int)" (?move@?$char_traits@D@std@@$$FSAPADPADPBDI@Z)
1>main.obj : error LNK2019: unresolved external symbol "void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)" (?_Debug_message@std@@$$FYAXPB_W0I@Z) referenced in function "public: void __thiscall std::_Iterator_base12::_Orphan_me(void)" (?_Orphan_me@_Iterator_base12@std@@$$FQAEXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall std::exception::~exception(void)" (??1exception@std@@$$FUAE@XZ) referenced in function "public: virtual __thiscall std::runtime_error::~runtime_error(void)" (??1runtime_error@std@@$$FUAE@XZ)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall std::exception::exception(class std::exception const &)" (??0exception@std@@$$FQAE@ABV01@@Z) referenced in function "public: __thiscall std::runtime_error::runtime_error(class std::runtime_error const &)" (??0runtime_error@std@@$$FQAE@ABV01@@Z)
1>main.obj : error LNK2001: unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual char const * __thiscall std::exception::what(void)const " (?what@exception@std@@UBEPBDXZ)
1>main.obj : error LNK2019: unresolved external symbol "extern "C" void __clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)" (?___CxxCallUnwindDtor@@$$J0YMXP6MXPAX@Z0@Z) referenced in function "public: __thiscall std::runtime_error::runtime_error(class std::runtime_error const &)" (??0runtime_error@std@@$$FQAE@ABV01@@Z)
1>main.obj : error LNK2001: unresolved external symbol __purecall
1>main.obj : error LNK2019: unresolved external symbol "bool __cdecl std::uncaught_exception(void)" (?uncaught_exception@std@@$$FYA_NXZ) referenced in function "bool __cdecl otl_uncaught_exception(void)" (?otl_uncaught_exception@@$$FYA_NXZ)
1>main.obj : error LNK2019: unresolved external symbol "void __cdecl operator delete[](void *)" (??_V@$$FYAXPAX@Z) referenced in function "public: __thiscall otl_column_desc::~otl_column_desc(void)" (??1otl_column_desc@@$$FQAE@XZ)
1>main.obj : error LNK2019: unresolved external symbol "void * __cdecl operator new[](unsigned int)" (??_U@$$FYAPAXI@Z) referenced in function "public: __thiscall otl_column_desc::otl_column_desc(class otl_column_desc const &)" (??0otl_column_desc@@$$FQAE@ABV0@@Z)
1>main.obj : error LNK2019: unresolved external symbol "extern "C" int __cdecl strcpy_s(char *,unsigned int,char const *)" (?strcpy_s@@$$J0YAHPADIPBD@Z) referenced in function "public: __thiscall otl_column_desc::otl_column_desc(class otl_column_desc const &)" (??0otl_column_desc@@$$FQAE@ABV0@@Z)
1>main.obj : error LNK2019: unresolved external symbol "extern "C" void * __cdecl memset(void *,int,unsigned int)" (?memset@@$$J0YAPAXPAXHI@Z) referenced in function "public: __thiscall otl_long_string::otl_long_string(int,int)" (??0otl_long_string@@$$FQAE@HH@Z)
1>main.obj : error LNK2019: unresolved external symbol "void __clrcall `eh vector destructor iterator'(void *,unsigned int,int,void (__clrcall*)(void *))" (??_M@$$FYMXPAXIHP6MX0@Z@Z) referenced in function "public: void * __thiscall otl_datetime::`vector deleting destructor'(unsigned int)" (??_Eotl_datetime@@$$FQAEPAXI@Z)
1>main.obj : error LNK2019: unresolved external symbol "void __cdecl operator delete(void *)" (??3@$$FYAXPAX@Z) referenced in function "public: void * __thiscall otl_datetime::`vector deleting destructor'(unsigned int)" (??_Eotl_datetime@@$$FQAEPAXI@Z)
1>main.obj : error LNK2019: unresolved external symbol "extern "C" int __cdecl strncpy_s(char *,unsigned int,char const *,unsigned int)" (?strncpy_s@@$$J0YAHPADIPBDI@Z) referenced in function "public: __thiscall otl_tmpl_exception<class otl_exc,class otl_conn,class otl_cur>::otl_tmpl_exception<class otl_exc,class otl_conn,class otl_cur>(class otl_conn &,char const *)" (??0?$otl_tmpl_exception@Votl_exc@@Votl_conn@@Votl_cur@@@@$$FQAE@AAVotl_conn@@PBD@Z)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall std::_Container_base12::~_Container_base12(void)" (??1_Container_base12@std@@$$FQAE@XZ) referenced in function "public: __thiscall std::_String_val<struct std::_Simple_types<char> >::~_String_val<struct std::_Simple_types<char> >(void)" (??1?$_String_val@U?$_Simple_types@D@std@@@std@@$$FQAE@XZ)
1>main.obj : error LNK2019: unresolved external symbol "void __cdecl std::_Xlength_error(char const *)" (?_Xlength_error@std@@$$FYAXPBD@Z) referenced in function "public: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Xlen(void)const " (?_Xlen@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@$$FQBEXXZ)
1>main.obj : error LNK2019: unresolved external symbol "void __cdecl std::_Xout_of_range(char const *)" (?_Xout_of_range@std@@$$FYAXPBD@Z) referenced in function "public: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Xran(void)const " (?_Xran@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@$$FQBEXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall std::_Container_base12::_Container_base12(void)" (??0_Container_base12@std@@$$FQAE@XZ) referenced in function "public: __thiscall std::_String_val<struct std::_Simple_types<char> >::_String_val<struct std::_Simple_types<char> >(void)" (??0?$_String_val@U?$_Simple_types@D@std@@@std@@$$FQAE@XZ)
1>main.obj : error LNK2019: unresolved external symbol "void * __cdecl operator new(unsigned int)" (??2@$$FYAPAXI@Z) referenced in function "struct std::_Container_proxy * __cdecl std::_Allocate<struct std::_Container_proxy>(unsigned int,struct std::_Container_proxy *)" (??$_Allocate@U_Container_proxy@std@@@std@@$$FYAPAU_Container_proxy@0@IPAU10@@Z)
1>main.obj : error LNK2019: unresolved external symbol "void __cdecl std::_Xbad_alloc(void)" (?_Xbad_alloc@std@@$$FYAXXZ) referenced in function "struct std::_Container_proxy * __cdecl std::_Allocate<struct std::_Container_proxy>(unsigned int,struct std::_Container_proxy *)" (??$_Allocate@U_Container_proxy@std@@@std@@$$FYAPAU_Container_proxy@0@IPAU10@@Z)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall std::_Lockit::_Lockit(int)" (??0_Lockit@std@@$$FQAE@H@Z) referenced in function "public: void __thiscall std::_Iterator_base12::_Adopt(struct std::_Container_base12 const *)" (?_Adopt@_Iterator_base12@std@@$$FQAEXPBU_Container_base12@2@@Z)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@$$FQAE@XZ) referenced in function "public: void __thiscall std::_Iterator_base12::_Adopt(struct std::_Container_base12 const *)" (?_Adopt@_Iterator_base12@std@@$$FQAEXPBU_Container_base12@2@@Z)
1>main.obj : error LNK2019: unresolved external symbol "extern "C" void __stdcall _CxxThrowException(void *,struct _s__ThrowInfo const *)" (?_CxxThrowException@@$$J18YGXPAXPBU_s__ThrowInfo@@@Z) referenced in function "public: void __thiscall otl_tmpl_connect<class otl_exc,class otl_conn,class otl_cur>::logoff(void)" (?logoff@?$otl_tmpl_connect@Votl_exc@@Votl_conn@@Votl_cur@@@@$$FQAEXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall std::_Container_base12::_Orphan_all(void)" (?_Orphan_all@_Container_base12@std@@$$FQAEXXZ) referenced in function "public: void __thiscall std::_String_alloc<0,struct std::_String_base_types<char,class std::allocator<char> > >::_Free_proxy(void)" (?_Free_proxy@?$_String_alloc@$0A@U?$_String_base_types@DV?$allocator@D@std@@@std@@@std@@$$FQAEXXZ)
1>main.obj : error LNK2019: unresolved external symbol "extern "C" int __cdecl __CxxQueryExceptionSize(void)" (?__CxxQueryExceptionSize@@$$J0YAHXZ) referenced in function "public: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Copy(unsigned int,unsigned int)" (?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@$$FQAEXII@Z)
1>main.obj : error LNK2019: unresolved external symbol "extern "C" int __cdecl __CxxExceptionFilter(void *,void *,int,void *)" (?__CxxExceptionFilter@@$$J0YAHPAX0H0@Z) referenced in function $LN14
1>main.obj : error LNK2019: unresolved external symbol "extern "C" int __cdecl __CxxRegisterExceptionObject(void *,void *)" (?__CxxRegisterExceptionObject@@$$J0YAHPAX0@Z) referenced in function $LN55
1>main.obj : error LNK2019: unresolved external symbol "extern "C" int __cdecl __CxxDetectRethrow(void *)" (?__CxxDetectRethrow@@$$J0YAHPAX@Z) referenced in function $LN23
1>main.obj : error LNK2019: unresolved external symbol "extern "C" void __cdecl __CxxUnregisterExceptionObject(void *,int)" (?__CxxUnregisterExceptionObject@@$$J0YAXPAXH@Z) referenced in function __catch$?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@$$FQAEXII@Z$3
1>main.obj : error LNK2019: unresolved external symbol "char const * __cdecl std::_Syserror_map(int)" (?_Syserror_map@std@@$$FYAPBDH@Z) referenced in function "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall std::_Generic_error_category::message(int)const " (?message@_Generic_error_category@std@@$$FUBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@H@Z)
1>main.obj : error LNK2019: unresolved external symbol "extern "C" unsigned int __cdecl strlen(char const *)" (?strlen@@$$J0YAIPBD@Z) referenced in function "public: static unsigned int __cdecl std::char_traits<char>::length(char const *)" (?length@?$char_traits@D@std@@$$FSAIPBD@Z)
1>main.obj : error LNK2019: unresolved external symbol "char const * __cdecl std::_Winerror_map(int)" (?_Winerror_map@std@@$$FYAPBDH@Z) referenced in function "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall std::_System_error_category::message(int)const " (?message@_System_error_category@std@@$$FUBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@H@Z)
1>main.obj : error LNK2019: unresolved external symbol "extern "C" int __clrcall _atexit_m(void (__clrcall*)(void))" (?_atexit_m@@$$J0YMHP6MXXZ@Z) referenced in function "void __clrcall `dynamic initializer for 'db''(void)" (???__Edb@@YMXXZ@?A0xbfeb62b6@@$$FYMXXZ)
1>LINK : error LNK2001: unresolved external symbol _mainCRTStartup
1>LINK : error LNK2001: unresolved external symbol __CorExeMain@0
我感觉还应该链接点什么库,要不然咱们这样啊?不过网上说OTL就是一个头文件就行了。
注:ODBC已经没问题了,我配置完了的时候点击了一下测试,显示可以链接。
|
|