RE: How to use EE with runtime /MDd, instead of /MT
Hi,
I spent the last four days trying what you suggested (i.e. bring the application in line with EE's MT). I found that ConnectorC++ source actually links to dlls and libs from mySql C-API (Mysql Client library), and these in turn were by default pre-compiled and linked to MDd runtime. So...I obtained the source for the C-API, and tried to rebuild it targeting MT. I could build NMake Files, but it failed before I could install them and compile to DLL and LIB files. I tried many combinations, but the forum help for C-API source builds is non-existent, and for ConnectorC++ there isn't much.
So, I then tried to see how far I could get targeting different and dual runtimes in my Esenthel app (i.e. set Esenthel (MT) to MDd) adding my code functions and headers one by one until it broke. I had to add several libraries (as outlined below for any forum user who might be interested). The upshot is I got most functionality working. I haven't tried that many of the sample Esenthel source examples, but day/night cycle and cloth work OK.
If you are interested, after a lot of trial and error, I had to add Additional Dependencies of
mysqlcppconn.lib (MySql ConnectorC++)
libmysql.lib (MySql C-Api client)
libcmt.lib (Microsoft lib)
msvcprtd.lib (Microsoft lib)
I could not get the std library classes of strcpy or Microsoft's strcpy_s to build. Strcpy produced the build error:
error LNK2019: unresolved external symbol __imp__strncpy referenced in function "public: struct EE::Str __thiscall mysql_tut::doSomething(void)" (?doSomething@mysql_tut@@QAE?AUStr@EE@@XZ)
I made a workaround using EE Str and iterated through a char array, but perhaps another forum member knows how to fix that.
I also could not get Masterxilo-and-Zeroo's console window workaround going in MDd, even though I had it working fine targeting MT:
AllocConsole();
freopen("CONIN$","rb",stdin);
freopen("CONOUT$","wb",stdout);
freopen("CONOUT$","wb",stderr);
I made a workaround for console output by writing debug info to EE screen by returning Str to D.text in the Draw() function of EE. However, if anyone can see an obvious solution to making strcpy and stdin work, that would be appreciated.
-a
(This post was last modified: 01-26-2011 12:55 AM by Antony.)
|