简体   繁体   中英

Boost 1.45 - 1.49 breaks with MySql C++ Connector 1.1 when using Visual Studio 2010

I have a C++ project that compiled fine under VS2008, but now I'm running VS2010 and not able to get back to 2008. That project isn't compiling anymore cause I get "error C2371: 'int8_t': redefinition; different basic types".

I've narrowed the problem down to using Boost 1.4x and MySQL C++ Connector. If I create a test.cpp file and put the following into it, then it generates the error.

// BOOST
#include <boost/filesystem.hpp>
// SQL connector
#include <mysql_connection.h>
#include <cppconn/resultset.h>

I've rebuild Boost 1.45, but still had the problem, then tried the latest 1.49 with the same result. There are no updates to the MySQL C++ Connector (v1.1)

I'm looking for possible recommendations or solutions to this problem.

Thanks,

Turns out there is a MySQL flag to disable the conflict. This seems to have resolved the issue for me.

// BOOST
#include <boost/filesystem.hpp>

#define HAVE_INT8_T 1

// SQL connector
#include <mysql_connection.h>
#include <cppconn/resultset.h>

Figures I find this moments after posting the question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM