首先: 我已经阅读了Avoiding conflicting declaration errors in typedef c++帖子,答案并没有解决我的问题: - (
我正在开发一个项目,我需要tesseract OCR和mysql,它们都在头文件中定义了LIST类型。
这里是错误信息:
Building file: ../src/CardRecognitionSystem.cpp
Invoking: GCC C++ Compiler
g++ -DHAVE_CONFIG_H -I/usr/local/include/opencv -I/usr/include/mysql -I/usr/include/leptonica -I/usr/local/include/tesseract -I/usr/local/include -O2 -g3 -Wall -c -fmessage-length=0 -fno-strict-aliasing -g -fabi-version=2 -fno-omit-frame-pointer -std=c++11 -MMD -MP -MF"src/CardRecognitionSystem.d" -MT"src/CardRecognitionSystem.d" -o "src/CardRecognitionSystem.o" "../src/CardRecognitionSystem.cpp"
In file included from /usr/include/mysql/mysql.h:75:0,
from ../src/CardRepoController.h:18,
from ../src/CardRecognitionSystem.h:24,
from ../src/CardRecognitionSystem.cpp:10:
/usr/include/mysql/my_list.h:26:3: error: conflicting declaration ‘typedef struct st_list LIST’
} LIST;
^
In file included from ../src/OCRStringResolver.h:17:0,
from ../src/CardNameResolver.h:11,
from ../src/CardRecognitionSystem.h:22,
from ../src/CardRecognitionSystem.cpp:10:
/usr/local/include/tesseract/baseapi.h:61:19: note: previous declaration as ‘typedef struct list_rec* LIST’
typedef list_rec *LIST
我只在CardRepoController.h中包含了mysql.h头文件,在其他文件中包含了tesseract头文件,但我需要在CardRecognitionSystem.h中使用它们。 在那里,我认为存在问题..
您是否有任何想法如何使用彼此旁边的两个库?