I'm using mysql++ 1.7.1 and VC++ 6.0.
At first, my program runs all right without MFC and singlethreaded.
But when migrated into platform with MFC and multithreaded, it got link
errors! Confliction among mysql++, libc, and msvcprtd...
(I have tried to the mysql++.lib recompiled from source, using the
"Multi Thread" and also "Multi Thread DLL" runtime library, but the
errors remain..)
Here are the link errors:
--------------------Configuration: VNMServer1 - Win32
Debug--------------------
Linking...
msvcprtd.lib(MSVCP60D.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_strin
g@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QA E@XZ) already defined
in mysql++.lib(sql_query.obj)
msvcprtd.lib(MSVCP60D.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<c
har,struct std::char_traits<char>,class std::allocator<char> > const
&)"
(??0?$basic_string@DU?$char_traits@D@std@@V?$alloc ator@D@2@@std@@QAE@ABV01@@Z)
already defined in mysql++.lib(sql_query.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: char const *
__thiscall std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::c_str(void)const "
(?c_str@?$basic_string@DU?$char_traits@D@std@@V?$a llocator@D@2@@std@@Q
BEPBDXZ) already defined in mysql++.lib(connection.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "class
std::basic_ostream<char,struct std::char_traits<char> > & __cdecl
std:

perator<<(class std::basic_ostream<char,struct
std::char_traits<char> > &,char const *)"
(??6std@@YAAAV?$basic_ostream@DU?$cha
r_traits@D@std@@@0@AAV10@PBD@Z) already defined in
mysql++.lib(sql_query.obj)
msvcprtd.lib(MSVCP60D.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::allocator<char
Quote:
const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$alloc ator@D@2@@std@@QAE@ABV?$allocator@D@1@@Z) already defined in mysql++.lib(connection.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: virtual __thiscall
|
std::basic_ios<char,struct std::char_traits<char>
Quote:
::~basic_ios<char,struct std::char_traits<char> >(void)" (??1?$basic_ios@DU?$char_traits@D@std@@@std@@UAE@X Z) already defined
in mysql++.lib(sql_query.obj)
|
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: virtual __thiscall
std::basic_iostream<char,struct std::char_traits<char>
Quote:
::~basic_iostream<char,struct std::char_traits<char> >(void)" (??1?$basic_iostream@DU?$char_traits@D@std@@@std@@ UAE@XZ) a
lready defined in mysql++.lib(sql_query.obj)
|
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall
std::basic_iostream<char,struct std::char_traits<char>
Quote:
::basic_iostream<char,struct std::char_traits<char> >(class std::basic_streambuf<char,struct std::char_traits<char> > *)" (??0?$b
asic_iostream@DU?$char_traits@D@std@@@std@@QAE@PAV ?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z)
|
already defined in mysql++.lib(sql_query.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: virtual __thiscall
std::basic_streambuf<char,struct std::char_traits<char>
Quote:
::~basic_streambuf<char,struct std::char_traits<char> >(void)" (??1?$basic_streambuf@DU?$char_traits@D@std@@@std@ @UAE@XZ
) already defined in mysql++.lib(sql_query.obj)
|
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: char & __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >:

perator[](unsigned int)"
(??A?$basic_string@DU?$char_traits@D@std@@V?$alloc ator@D@2@@std@@QAEA
ADI@Z) already defined in mysql++.lib(field_names.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall
std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined
in mysql++.lib(sql_query.obj)
msvcprtd.lib(MSVCP60D.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(unsign
ed int,unsigned int)"
(?erase@?$basic_string@DU?$char_traits@D@std@@V?$a llocator@D@2@@std@@QAEAAV12@II@Z)
already defined in mysql++.lib(sql_query.obj)
libcp.lib(locale.obj) : error LNK2005: "public: __thiscall
std::_Locinfo::_Locinfo(char const *)" (??0_Locinfo@std@@QAE@PBD@Z)
already defined in msvcprtd.lib(MSVCP60D.dll)
libcp.lib(locale.obj) : error LNK2005: "public: __thiscall
std::_Locinfo::~_Locinfo(void)" (??1_Locinfo@std@@QAE@XZ) already
defined in msvcprtd.lib(MSVCP60D.dll)
libcp.lib(locale0.obj) : error LNK2005: "public: class
std::locale::facet const * __thiscall std::locale::_Getfacet(unsigned
int,bool)const " (?_Getfacet@locale@std@@QBEPBVfacet@12@I_N@Z) already
defined in msvcprtd.lib(MSVCP60D.dll)
libcp.lib(locale0.obj) : error LNK2005: "public: bool __thiscall
std::locale::_Iscloc(void)const " (?_Iscloc@locale@std@@QBE_NXZ)
already defined in msvcprtd.lib(MSVCP60D.dll)
libcp.lib(locale0.obj) : error LNK2005: "private: static class
std::locale::_Locimp * __cdecl std::locale::_Init(void)"
(?_Init@locale@std@@CAPAV_Locimp@12@XZ) already defined in
msvcprtd.lib(MSVCP60D.dll)
libcp.lib(ios.obj) : error LNK2005: "public: void __thiscall
std::ios_base::clear(int,bool)" (?clear@ios_base@std@@QAEXH_N@Z)
already defined in msvcprtd.lib(MSVCP60D.dll)
libcp.lib(ios.obj) : error LNK2005: "public: virtual __thiscall
std::ios_base::~ios_base(void)" (??1ios_base@std@@UAE@XZ) already
defined in msvcprtd.lib(MSVCP60D.dll)
libcp.lib(ios.obj) : error LNK2005: "protected: void __thiscall
std::ios_base::_Init(void)" (?_Init@ios_base@std@@IAEXXZ) already
defined in msvcprtd.lib(MSVCP60D.dll)
LIBC.lib(crt0dat.obj) : error LNK2005: _exit already defined in
msvcrtd.lib(MSVCRTD.dll)
LIBC.lib(crt0dat.obj) : error LNK2005: __exit already defined in
msvcrtd.lib(MSVCRTD.dll)
LIBC.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in
msvcrtd.lib(cinitexe.obj)
LIBC.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in
msvcrtd.lib(cinitexe.obj)
LIBC.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in
msvcrtd.lib(cinitexe.obj)
LIBC.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in
msvcrtd.lib(cinitexe.obj)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: __setmbcp already defined in
LIBC.lib(mbctype.obj)
LINK : warning LNK4098: defaultlib "msvcrtd.lib" conflicts with use of
other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other
libs; use /NODEFAULTLIB:library
LIBC.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/VNMServer1.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
VNMServer1.exe - 29 error(s), 2 warning(s)