MySQL连接器和VC2010头冲突 [英] MySQL Connector and VC2010 header collision
问题描述
我的应用程序使用包含config.h的MySQL / C ++连接器,如下所示。
My application uses the MySQL/C++ Connector which includes config.h that goes like below.
// ...
#if !defined(HAVE_INT8_T) && defined(HAVE_MS_INT8)
typedef __int8 int8_t;
#endif
// ...
2010年MSVCR100,我的应用程序还包括stdint.h ..
Since I'm using VC++ 2010 with MSVCR100, my application also includes stdint.h that goes..
/* TYPE DEFINITIONS */
typedef signed char int8_t;
typedef short int16_t;
typedef int int32_t;
// ...
两个int8_t使得碰撞编译错误。
The two int8_t makes this collision compile error.
我做了一些google搜索,但没有人知道这个完美的解决方案。
I did some google reserarch but no one seems to know the perfect solution to this.
任何帮助将不胜感激。
Any helps would be appreciated.
感谢大家。
推荐答案
您尝试过#define HAVE_INT8_T (和类似,我想在其他类型发生相同)包括MySQL头之前?
Did you try #define HAVE_INT8_T (and similar, I guess the same happens for other types) before including the MySQL header?
Ie像
...
#define HAVE_INT8_T
#include "MySQL.h"
...
编辑:如果MySQL.h包含类似config.h再次拧紧东西,你可以尝试直接包括config.h,然后调整不正确的定义,然后包括MySQL.h。在config.h周围可能会有一个包含守卫,以防止它被再次包含。
If MySQL.h includes something like a "config.h", which screws up things again, you could try to directly include that config.h, then adjust the incorrect defines, then include the MySQL.h. There'll probably be an include guard around the config.h to prevent it from being included again.
这篇关于MySQL连接器和VC2010头冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!