Re: How to build mysqlclient.lib 5.7 without MSVCR120 dependency
Posted by: Adrián G.
Date: August 21, 2022 12:43PM

So I added the _ALLOW_RUNTIME_LIBRARY_MISMATCH flag, which I found, to MySQL solution generation command, like this:

cmake -Bbuild -G "Visual Studio 12 2013" -Tv120_xp -DCMAKE_CXX_FLAGS=/D_ALLOW_RUNTIME_LIBRARY_MISMATCH -DBUILD_CONFIG=mysql_release -DLINK_STATIC_RUNTIME_LIBRARIES=1 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=../my_boost -DWITH_SSL="C:\Program Files (x86)\OpenSSL" -DWITHOUT_SERVER=1

Afterwards, I can produce a mysqlclient.lib in MinSizeRel mode that can compile with my program in both Debug and Release modes. However, this change makes my program crash at mysql_end during mysql_real_connect. I wonder which difference/s this 'innocent' flag makes to the library that makes it incompatible in my program at runtime.

Anyway, if I opt out this approach and instead go the two separate Release/Debug mysqlclient libraries way (and after setting _HAS_ITERATOR_DEBUGGING=0 flag required to link within my program in Debug mode), my program crashes too at the same point in Debug mode.

Help, please. I know this might be quite advanced stuff, thoug.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: How to build mysqlclient.lib 5.7 without MSVCR120 dependency
195
August 21, 2022 12:43PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.