我正在使用 C 接口,当我包含“ml.h”时运行 ndk-build 时出现以下错误:
In file included from /Users/user/android-ndk-r7c/sources/cxx-stl/gnu-libstdc++/include/bits/stl_algobase.h:61,
from /Users/user/android-ndk-r7c/sources/cxx-stl/gnu-libstdc++/include/bits/stl_tree.h:62,
from /Users/user/android-ndk-r7c/sources/cxx-stl/gnu-libstdc++/include/map:60,
from /Users/user/android-opencv/OpenCV-2.3.1/share/OpenCV/../../include/opencv2/ml/ml.hpp:2022,
from /Users/user/android-opencv/OpenCV-2.3.1/share/OpenCV/../../include/opencv/ml.h:46,
from /Users/user/CarSafe/jni/blink_detection.c:7:
/Users/user/android-ndk-r7c/sources/cxx-stl/gnu-libstdc++/include/cstddef:51: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
如果我注释掉“ml.h”的包含,它可以正常编译并正常运行。
问题是我想在我的 C 代码中使用 opencv svm 库。我究竟做错了什么?或者我应该将它编译为 C++ 代码并在 C++ 中使用 ml.hpp 标头。这适用于项目中的其他代码。