有没有办法让 g++ 忽略或解决冲突的 typedef?
背景:
我正在为 gridlab_d 模拟器编写一些 C++ 代码。我的模型需要连接到 c++ 数据库,所以我使用的是 mysql++ 库。使用 mysql++ 库需要我链接到 mysql 库,所以我编译
g++ -I/usr/include/mysql -I/usr/local/include/mysql++
问题:
gridlab typedef 中的 mysql.h 和 list.h 都是一个名为 LIST 的结构。这是编译器错误
In file included from /usr/include/mysql/mysql.h:76,
from /usr/include/mysql++/common.h:182,
from /usr/include/mysql++/connection.h:38,
from /usr/include/mysql++/mysql++.h:56,
from direct_data.cpp:21:
/usr/include/mysql/my_list.h: At global scope:
/usr/include/mysql/my_list.h:26: error: conflicting declaration 'typedef struct st_list LIST'
../core/list.h:22: error: 'LIST' has a previous declaration as 'typedef struct s_list LIST'
谢谢你的帮助!