Hi all,
is it possible to compile the MySQL++ library so I can use it in an
application that needs to be built as "MFC in a static library" and
"Multithreaded (/MT)"?
My build environment: MS VC 7.1.6030 (VS2003), WinXP, MySQL 5.0.58 commercial.
My problem:
If I compile MySQL++ as "Multithreaded DLL (/MD)" it does not link
with my application (getting lots of unresolved externals linker
errors of STL stuff like
---8<--------------
error LNK2019: unresolved external symbol '"__declspec(dllimport)
public: void __thiscall std::basic_ostream<char,struct
std::char_traits<char> >::_Osfx(void)"
(__imp_?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ)',
used in function '"public: __thiscall std::basic_ostream<char,struct
std::char_traits<char> >::sentry::~sentry(void)"
(??1sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ)'
--->8--------------
).
If I compile MySQL++ as "Multithreaded (/MT)" it links but my
application crashes when Calling the str() methods of Query and
DateTime instances when leaving the current scope.
You can easily verify this by compiling just the mysqlpp-Project as
"/MT" and add
---8<--------------
mysqlpp::DateTime dt( 2008, 04, 22, 12, 22, 22 );
string qstr = dt.str();
cout << "test: " << dt << std::endl;
--->8--------------
to simple2.cpp.
Strangely, if I compile excommon and simple2 as "Multithreaded (/MT)"
it also does not link, although all should fit together in that case.
I would be very glad if anybody could shed some light on this issue(s)...
Thanks in advance,
-oli-
(O. Baum)