MySQL++ - Welche lib?
-
Hi!
Ich versuche gerade ein Konsolenprogramm in VC ++ 2003 .NET zu schreiben
jetzt bekomme ich folgende Linkerfehler:------ Build started: Project: mysqltest, Configuration: Debug Win32 ------ Linking... mysqltest.obj : error LNK2019: unresolved external symbol "public: __thiscall mysqlpp::Connection::~Connection(void)" (??1Connection@mysqlpp@@QAE@XZ) referenced in function _main mysqltest.obj : error LNK2019: unresolved external symbol "public: class mysqlpp::Query __thiscall mysqlpp::Connection::query(void)" (?query@Connection@mysqlpp@@QAE?AVQuery@2@XZ) referenced in function _main mysqltest.obj : error LNK2019: unresolved external symbol "public: __thiscall mysqlpp::Connection::Connection(char const *,char const *,char const *,char const *,bool)" (??0Connection@mysqlpp@@QAE@PBD000_N@Z) referenced in function _main Debug/mysqltest.exe : fatal error LNK1120: 3 unresolved externals Build log was saved at "***" mysqltest - 4 error(s), 0 warning(s) ---------------------- Done ---------------------- Build: 0 succeeded, 1 failed, 0 skipped
so...
jetzt frage ich euch, welche lib muss ich linken?
-
die mysql++ lib. nicht nur inkludieren, sondern auch linken.
-
wenn ich das mache, dann bekomme ich noch mehr linker error
------ Build started: Project: mysqltest, Configuration: Debug Win32 ------ Linking... msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) already defined in mysqltest.obj msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in mysqltest.obj msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in libcpd.lib(locale0.obj) msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(char const *)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z) already defined in mysqltest.obj msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall std::_Mutex::_Unlock(void)" (?_Unlock@_Mutex@std@@QAEXXZ) already defined in mysqltest.obj msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall std::_Mutex::_Lock(void)" (?_Lock@_Mutex@std@@QAEXXZ) already defined in mysqltest.obj msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall std::locale::facet::_Register(void)" (?_Register@facet@locale@std@@QAEXXZ) already defined in libcpd.lib(locale0.obj) msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall std::locale::facet::_Incref(void)" (?_Incref@facet@locale@std@@QAEXXZ) already defined in libcpd.lib(ios.obj) msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class std::locale::facet const * __thiscall std::locale::_Getfacet(unsigned int)const " (?_Getfacet@locale@std@@QBEPBVfacet@12@I@Z) already defined in libcpd.lib(locale0.obj) msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined in mysqltest.obj msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QAE@H@Z) already defined in mysqltest.obj msvcprt.lib(MSVCP71.dll) : error LNK2005: "bool __cdecl std::uncaught_exception(void)" (?uncaught_exception@std@@YA_NXZ) already defined in libcpd.lib(uncaught.obj) msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::flush(void)" (?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ) already defined in mysqltest.obj msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall std::basic_ostream<char,struct std::char_traits<char> >::_Osfx(void)" (?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in mysqltest.obj msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall std::ios_base::clear(int,bool)" (?clear@ios_base@std@@QAEXH_N@Z) already defined in libcpd.lib(ios.obj) msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::max_size(void)const " (?max_size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ) already defined in mysqltest.obj msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::erase(unsigned int,unsigned int)" (?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z) already defined in mysqltest.obj msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::locale::~locale(void)" (??1locale@std@@QAE@XZ) already defined in mysqltest.obj msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputc(char)" (?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z) already defined in mysqltest.obj msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: virtual __thiscall std::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ) already defined in mysqltest.obj msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: virtual __thiscall std::basic_ios<char,struct std::char_traits<char> >::~basic_ios<char,struct std::char_traits<char> >(void)" (??1?$basic_ios@DU?$char_traits@D@std@@@std@@UAE@XZ) already defined in mysqltest.obj msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator=(char const *)" (??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z) already defined in libcpd.lib(locale0.obj) mysql++.lib(field_names.obj) : warning LNK4049: locally defined symbol ??1exception@@UAE@XZ (public: virtual __thiscall exception::~exception(void)) imported mysql++.lib(type_info.obj) : warning LNK4049: locally defined symbol ??1exception@@UAE@XZ (public: virtual __thiscall exception::~exception(void)) imported mysql++.lib(connection.obj) : warning LNK4217: locally defined symbol ??1exception@@UAE@XZ (public: virtual __thiscall exception::~exception(void)) imported in function $L86571 mysql++.lib(result.obj) : warning LNK4049: locally defined symbol ??1exception@@UAE@XZ (public: virtual __thiscall exception::~exception(void)) imported mysql++.lib(row.obj) : warning LNK4049: locally defined symbol ??1exception@@UAE@XZ (public: virtual __thiscall exception::~exception(void)) imported mysql++.lib(field_types.obj) : warning LNK4049: locally defined symbol ??1exception@@UAE@XZ (public: virtual __thiscall exception::~exception(void)) imported mysql++.lib(field_names.obj) : warning LNK4049: locally defined symbol ??0exception@@QAE@XZ (public: __thiscall exception::exception(void)) imported mysql++.lib(type_info.obj) : warning LNK4049: locally defined symbol ??0exception@@QAE@XZ (public: __thiscall exception::exception(void)) imported mysql++.lib(connection.obj) : warning LNK4217: locally defined symbol ??0exception@@QAE@XZ (public: __thiscall exception::exception(void)) imported in function "public: __thiscall std::logic_error::logic_error(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0logic_error@std@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z) mysql++.lib(result.obj) : warning LNK4049: locally defined symbol ??0exception@@QAE@XZ (public: __thiscall exception::exception(void)) imported mysql++.lib(row.obj) : warning LNK4049: locally defined symbol ??0exception@@QAE@XZ (public: __thiscall exception::exception(void)) imported mysql++.lib(field_types.obj) : warning LNK4049: locally defined symbol ??0exception@@QAE@XZ (public: __thiscall exception::exception(void)) imported mysql++.lib(field_names.obj) : warning LNK4049: locally defined symbol ??0exception@@QAE@ABV0@@Z (public: __thiscall exception::exception(class exception const &)) imported mysql++.lib(type_info.obj) : warning LNK4049: locally defined symbol ??0exception@@QAE@ABV0@@Z (public: __thiscall exception::exception(class exception const &)) imported mysql++.lib(connection.obj) : warning LNK4217: locally defined symbol ??0exception@@QAE@ABV0@@Z (public: __thiscall exception::exception(class exception const &)) imported in function "public: __thiscall mysqlpp::BadQuery::BadQuery(class mysqlpp::BadQuery const &)" (??0BadQuery@mysqlpp@@QAE@ABV01@@Z) mysql++.lib(result.obj) : warning LNK4049: locally defined symbol ??0exception@@QAE@ABV0@@Z (public: __thiscall exception::exception(class exception const &)) imported mysql++.lib(row.obj) : warning LNK4049: locally defined symbol ??0exception@@QAE@ABV0@@Z (public: __thiscall exception::exception(class exception const &)) imported mysql++.lib(field_types.obj) : warning LNK4049: locally defined symbol ??0exception@@QAE@ABV0@@Z (public: __thiscall exception::exception(class exception const &)) imported mysql++.lib(field_types.obj) : warning LNK4049: locally defined symbol ??0bad_cast@@QAE@PBD@Z (public: __thiscall bad_cast::bad_cast(char const *)) imported mysql++.lib(field_names.obj) : warning LNK4217: locally defined symbol ??0bad_cast@@QAE@PBD@Z (public: __thiscall bad_cast::bad_cast(char const *)) imported in function "class std::basic_istream<unsigned short,struct std::char_traits<unsigned short> > & __cdecl std::operator>><unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >(class std::basic_istream<unsigned short,struct std::char_traits<unsigned short> > &,class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > &)" (??$?5GU?$char_traits@G@std@@V?$allocator@G@1@@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@0@AAV10@AAV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z) mysql++.lib(type_info.obj) : warning LNK4049: locally defined symbol ??0bad_cast@@QAE@PBD@Z (public: __thiscall bad_cast::bad_cast(char const *)) imported mysql++.lib(connection.obj) : warning LNK4217: locally defined symbol ??0bad_cast@@QAE@PBD@Z (public: __thiscall bad_cast::bad_cast(char const *)) imported in function "class std::ctype<char> const & __cdecl std::use_facet<class std::ctype<char> >(class std::locale const &)" (??$use_facet@V?$ctype@D@std@@@std@@YAABV?$ctype@D@0@ABVlocale@0@@Z) mysql++.lib(result.obj) : warning LNK4049: locally defined symbol ??0bad_cast@@QAE@PBD@Z (public: __thiscall bad_cast::bad_cast(char const *)) imported mysql++.lib(fields.obj) : warning LNK4049: locally defined symbol ??0bad_cast@@QAE@PBD@Z (public: __thiscall bad_cast::bad_cast(char const *)) imported mysql++.lib(row.obj) : warning LNK4049: locally defined symbol ??0bad_cast@@QAE@PBD@Z (public: __thiscall bad_cast::bad_cast(char const *)) imported mysql++.lib(connection.obj) : warning LNK4217: locally defined symbol _memmove imported in function "public: class std::vector<unsigned int,class std::allocator<unsigned int> >::iterator __thiscall std::vector<unsigned int,class std::allocator<unsigned int> >::erase(class std::vector<unsigned int,class std::allocator<unsigned int> >::iterator,class std::vector<unsigned int,class std::allocator<unsigned int> >::iterator)" (?erase@?$vector@IV?$allocator@I@std@@@std@@QAE?AViterator@12@V312@0@Z) mysql++.lib(row.obj) : warning LNK4217: locally defined symbol _tolower imported in function "void __cdecl mysqlpp::str_to_lwr(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)" (?str_to_lwr@mysqlpp@@YAXAAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) mysql++.lib(field_names.obj) : warning LNK4049: locally defined symbol _tolower imported mysql++.lib(type_info.obj) : warning LNK4217: locally defined symbol ?before@type_info@@QBEHABV1@@Z (public: int __thiscall type_info::before(class type_info const &)const ) imported in function "public: bool __thiscall mysqlpp::type_info_cmp::operator()(class type_info const *,class type_info const *)const " (??Rtype_info_cmp@mysqlpp@@QBE_NPBVtype_info@@0@Z) mysql++.lib(type_info.obj) : warning LNK4217: locally defined symbol ??8type_info@@QBEHABV0@@Z (public: int __thiscall type_info::operator==(class type_info const &)const ) imported in function "public: bool __thiscall mysqlpp::mysql_type_info::quote_q(void)const " (?quote_q@mysql_type_info@mysqlpp@@QBE_NXZ) mysql++.lib(connection.obj) : error LNK2019: unresolved external symbol _mysql_num_rows@4 referenced in function "public: virtual unsigned int __thiscall mysqlpp::Result::size(void)const " (?size@Result@mysqlpp@@UBEIXZ) mysql++.lib(connection.obj) : error LNK2019: unresolved external symbol _mysql_error@4 referenced in function "public: char const * __thiscall mysqlpp::Connection::error(void)" (?error@Connection@mysqlpp@@QAEPBDXZ) mysql++.lib(connection.obj) : error LNK2019: unresolved external symbol _mysql_init@4 referenced in function "public: __thiscall mysqlpp::Connection::Connection(void)" (??0Connection@mysqlpp@@QAE@XZ) mysql++.lib(connection.obj) : error LNK2019: unresolved external symbol _mysql_close@4 referenced in function "public: __thiscall mysqlpp::Connection::~Connection(void)" (??1Connection@mysqlpp@@QAE@XZ) mysql++.lib(connection.obj) : error LNK2019: unresolved external symbol _mysql_select_db@8 referenced in function "public: bool __thiscall mysqlpp::Connection::select_db(char const *)" (?select_db@Connection@mysqlpp@@QAE_NPBD@Z) mysql++.lib(connection.obj) : error LNK2019: unresolved external symbol _mysql_refresh@8 referenced in function "public: bool __thiscall mysqlpp::Connection::reload(void)" (?reload@Connection@mysqlpp@@QAE_NXZ) mysql++.lib(connection.obj) : error LNK2019: unresolved external symbol _mysql_shutdown@8 referenced in function "public: bool __thiscall mysqlpp::Connection::shutdown(void)" (?shutdown@Connection@mysqlpp@@QAE_NXZ) mysql++.lib(connection.obj) : error LNK2019: unresolved external symbol _mysql_real_connect@32 referenced in function "public: bool __thiscall mysqlpp::Connection::connect(char const *,char const *,char const *,char const *)" (?connect@Connection@mysqlpp@@QAE_NPBD000@Z) mysql++.lib(connection.obj) : error LNK2019: unresolved external symbol _mysql_options@12 referenced in function "public: bool __thiscall mysqlpp::Connection::connect(char const *,char const *,char const *,char const *)" (?connect@Connection@mysqlpp@@QAE_NPBD000@Z) mysql++.lib(connection.obj) : error LNK2019: unresolved external symbol _mysql_info@4 referenced in function "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall mysqlpp::Connection::info(void)" (?info@Connection@mysqlpp@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) mysql++.lib(connection.obj) : error LNK2019: unresolved external symbol _mysql_query@8 referenced in function "public: class mysqlpp::ResNSel __thiscall mysqlpp::Connection::execute(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,bool)" (?execute@Connection@mysqlpp@@QAE?AVResNSel@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_N@Z) mysql++.lib(connection.obj) : error LNK2019: unresolved external symbol _mysql_store_result@4 referenced in function "public: class mysqlpp::Result __thiscall mysqlpp::Connection::store(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,bool)" (?store@Connection@mysqlpp@@QAE?AVResult@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_N@Z) mysql++.lib(connection.obj) : error LNK2019: unresolved external symbol _mysql_use_result@4 referenced in function "public: class mysqlpp::ResUse __thiscall mysqlpp::Connection::use(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,bool)" (?use@Connection@mysqlpp@@QAE?AVResUse@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_N@Z) mysql++.lib(connection.obj) : error LNK2019: unresolved external symbol _mysql_data_seek@12 referenced in function "public: virtual class mysqlpp::Row const __thiscall mysqlpp::Result::operator[](unsigned int)const " (??AResult@mysqlpp@@UBE?BVRow@1@I@Z) mysql++.lib(connection.obj) : error LNK2019: unresolved external symbol _mysql_fetch_lengths@4 referenced in function "public: class mysqlpp::Row const __thiscall mysqlpp::Result::fetch_row(void)const " (?fetch_row@Result@mysqlpp@@QBE?BVRow@2@XZ) mysql++.lib(connection.obj) : error LNK2019: unresolved external symbol _mysql_fetch_row@4 referenced in function "public: class mysqlpp::Row const __thiscall mysqlpp::Result::fetch_row(void)const " (?fetch_row@Result@mysqlpp@@QBE?BVRow@2@XZ) mysql++.lib(result.obj) : error LNK2019: unresolved external symbol _mysql_affected_rows@4 referenced in function "public: unsigned __int64 __thiscall mysqlpp::Connection::affected_rows(void)" (?affected_rows@Connection@mysqlpp@@QAE_KXZ) mysql++.lib(result.obj) : error LNK2019: unresolved external symbol _mysql_insert_id@4 referenced in function "public: unsigned __int64 __thiscall mysqlpp::Connection::insert_id(void)" (?insert_id@Connection@mysqlpp@@QAE_KXZ) mysql++.lib(result.obj) : error LNK2019: unresolved external symbol _mysql_free_result@4 referenced in function "public: void __thiscall mysqlpp::ResUse::purge(void)" (?purge@ResUse@mysqlpp@@QAEXXZ) mysql++.lib(fields.obj) : error LNK2019: unresolved external symbol _mysql_fetch_field@4 referenced in function "public: struct st_mysql_field & __thiscall mysqlpp::ResUse::fetch_field(void)const " (?fetch_field@ResUse@mysqlpp@@QBEAAUst_mysql_field@@XZ) mysql++.lib(fields.obj) : error LNK2019: unresolved external symbol _mysql_field_seek@8 referenced in function "public: void __thiscall mysqlpp::ResUse::field_seek(int)" (?field_seek@ResUse@mysqlpp@@QAEXH@Z) mysql++.lib(fields.obj) : error LNK2019: unresolved external symbol _mysql_num_fields@4 referenced in function "public: int __thiscall mysqlpp::ResUse::num_fields(void)const " (?num_fields@ResUse@mysqlpp@@QBEHXZ) mysql++.lib(row.obj) : error LNK2001: unresolved external symbol _mysql_num_fields@4 mysql++.lib(field_types.obj) : error LNK2001: unresolved external symbol _mysql_num_fields@4 mysql++.lib(field_names.obj) : error LNK2001: unresolved external symbol _mysql_num_fields@4 Debug/mysqltest.exe : fatal error LNK1120: 22 unresolved externals Build log was saved at "***" mysqltest - 48 error(s), 30 warning(s) ---------------------- Done ---------------------- Build: 0 succeeded, 1 failed, 0 skipped
-
Schau mal auf meine Seite. Da gibt es auch eine Wrapper mit dem einige von hier sehr zufrieden sind.
Die Header ist selbsterklärend.