我正在使用兩個獨立的庫的Qt平臺。我面臨的問題是他的兩個庫對int32_t有不同的聲明。第三方庫衝突的定義/ redefinitons
的第一庫具有:
#ifdef _WIN32
#if ULONG_MAX == 0xffffffff
typedef long int32_t;
#else
typedef int int32_t;
#endif
#endif
第二圖書館:
typedef signed __int32 int32_t;
typedef unsigned __int32 uint32_t;
,我得到的錯誤是:
C:\Program Files (x86)\SiliconSoftware\Runtime5.1\include\msinttypes\stdint.h:91: error: C2371: 'int32_t' : redefinition; different basic types c:\program files (x86)\matlab\r2008a\extern\include\mclmcr.h:216: see declaration of 'int32_t'
我嘗試下面這個職位上計算器:
Typedef redefinition (C2371) for uint32 in two 3rd-party libraries
,我試圖實現它在我的代碼:
#define int32_t VicTorv3_int32_t
#include"mclmcr.h"
#undef int32_t
#define int32_t Silicon_int32_t
#include "stdint.h"
#undef int32_t
我仍然得到同樣的錯誤。請幫忙。