问题描述
我正在使用opencv4.3.0构建openpilot,
opencv头文件存在错误:
clang++ -o selfdrive/camerad/cameras/camera_webcam.o -c -std=c++14 -DWEBCAM -g -fPIC -O2 -Wunused -Werror -Wno-deprecated-register -Wno-inconsistent-missing-override -Iexternal/tensorflow/include -I. -Iselfdrive -Iphonelibs/bzip2 -Iphonelibs/libyuv/include -Iphonelibs/openmax/include -Iphonelibs/json11 -Iphonelibs/curl/include -Iphonelibs/libgralloc/include -Iphonelibs/android_frameworks_native/include -Iphonelibs/android_hardware_libhardware/include -Iphonelibs/android_system_core/include -Iphonelibs/linux/include -Iphonelibs/snpe/include -Iphonelibs/nanovg -Iselfdrive/common -Iselfdrive/camerad -Iselfdrive/camerad/include -Iselfdrive/loggerd/include -Iselfdrive/modeld -Iselfdrive/sensord -Iselfdrive/ui -Icereal/messaging -Icereal -Iopendbc/can -Iphonelibs/json11 -I/usr/local/include/opencv4 selfdrive/camerad/cameras/camera_webcam.cc
In file included from selfdrive/camerad/cameras/camera_webcam.cc:13:
In file included from /usr/local/include/opencv4/opencv2/opencv.hpp:52:
In file included from /usr/local/include/opencv4/opencv2/core.hpp:54:
In file included from /usr/local/include/opencv4/opencv2/core/base.hpp:58:
In file included from /usr/local/include/opencv4/opencv2/core/cvstd.hpp:81:
/usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp:47:60: error: inline function
'cv::sfinae::has_parenthesis_operator<cv::DefaultDeleter<cv::detail::PaniniPortraitWarper>,void,cv::detail::PaniniPortraitWarper
*>::check<cv::DefaultDeleter<cv::detail::PaniniPortraitWarper> >' is not defined [-Werror,-Wundefined-inline]
template<typename> static CV_CONSTEXPR std::false_type check(...);
^
/usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp:49:22: note: used here
typedef decltype(check<C>(0)) type;
^
/usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp:47:60: error: inline function 'cv::sfinae::has_parenthesis_operator<cv::DefaultDeleter<cv::detail::FisheyeWarper>,cv::detail::FisheyeWarper *>::check<cv::DefaultDeleter<cv::detail::FisheyeWarper> >' is not defined [-Werror,-Wundefined-inline]
template<typename> static CV_CONSTEXPR std::false_type check(...);
^
/usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp:49:22: note: used here
typedef decltype(check<C>(0)) type;
^
有什么建议吗?
谢谢。
我使用c ++ 11构建opencv,因此我将cxxflag从-std = c ++ 14更改为-std = c ++ 11,但是它带有相同的错误。
opencv头文件的内容
namespace sfinae {
template<typename C,typename Ret,typename... Args>
struct has_parenthesis_operator
{
private:
template<typename T>
static CV_CONSTEXPR std::true_type check(typename std::is_same<typename std::decay<decltype(std::declval<T>().operator()(std::declval<Args>()...))>::type,Ret>::type*);
template<typename> static CV_CONSTEXPR std::false_type check(...);
typedef decltype(check<C>(0)) type;
public:
#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900/*MSVS 2015*/)
static CV_CONSTEXPR bool value = type::value;
#else
// support MSVS 2013
static const int value = type::value;
#endif
};
} // namespace sfinae
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)