带有Mat分配的Eclipse CDT语法错误解析器错误:它可以编译并正常运行 [英] Eclipse CDT syntax error parser false error with Mat assignment: It compiles and runs ok
问题描述
在此代码行中,x用红色下划线标记为错误:
In this line of code, the x is red underlined as error:
cv::Mat x = cv::Mat::eye(2,2,CV_8U);
具有以下说明:
Invalid arguments '
Candidates are:
Mat()
Mat(int, int, int)
Mat(int, int, int, const cv::Scalar_<double> &)
... (it goes on, full error description at the bottom)
它可以编译并正常运行。
It compiles and runs ok.
09:12:02 Build Finished. 0 errors, 0 warnings. (took 1s.721ms)
它过去工作正常。我无法确切知道何时开始,但是在中间,我将Eclipse更新为最新的稳定版本版本: 2019-06(4.12.0)Build ID:20190614-1200。
It used to work fine. I can't tell exactly when this started, but in the middle I updated Eclipse to the last stable version Version: 2019-06 (4.12.0) Build id: 20190614-1200.
与解析器有关。我正在使用elf-parser作为错误解析器(Linux的默认配置)。我尝试使用c ++ 11和c ++ 17,但没有告诉要使用哪个C ++。
It's something with the parser. I'm using elf-parser as error parser (the default configuration for Linux). I tried with c++11 and c++17, and without telling which C++ to use.
分配时会发生一般的错误错误MatExpr
转换为 Mat
声明。 MatExpr
应该会自动转换为 Mat
(就像往常一样)。它对opencv来说太具体了,但是有时错误分析器无法识别 std :: endl
,因此我认为分析器的问题并不特定于opencv。
The generic false error happens when assigning a MatExpr
to a Mat
declaration. MatExpr
is supposed to be automatically cast to Mat
(like it always did). It's too specific to opencv, but sometimes error parser fails to recognize std::endl
, so I believe the problem with the parser isn't specific to opencv.
完整的错误描述,我很确定这里没有相关内容:
Full error description for completeness, I'm pretty sure there is nothing relevant here:
Invalid arguments '
Candidates are:
Mat()
Mat(int, int, int)
Mat(int, int, int, const cv::Scalar_<double> &)
Mat(cv::Size_<int>, int)
Mat(cv::Size_<int>, int, const cv::Scalar_<double> &)
Mat(int, const int *, int)
Mat(int, const int *, int, const cv::Scalar_<double> &)
Mat(const std::vector<int,std::allocator<int>> &, int)
Mat(const std::vector<int,std::allocator<int>> &, int, const cv::Scalar_<double> &)
Mat(const cv::Mat &)
Mat(int, int, int, void *, unsigned long int)
Mat(cv::Size_<int>, int, void *, unsigned long int)
Mat(const std::vector<#0,std::allocator<#0>> &, bool)
Mat(std::initializer_list<#0>)
Mat(std::initializer_list<int>, std::initializer_list<#0>)
Mat(const std::array<#0,unsigned long int3 #1 0> &, bool)
Mat(const cv::Vec<#0,int3 #1 0> &, bool)
Mat(const cv::Matx<#0,int3 #1 0,int3 #2 0> &, bool)
Mat(const cv::Point_<#0> &, bool)
Mat(const cv::Point3_<#0> &, bool)
Mat(const cv::MatCommaInitializer_<#0> &)
Mat(const cv::Mat &, const cv::Range &, const cv::Range &)
Mat(const cv::Mat &, const cv::Rect_<int> &)
Mat(const cv::Mat &, const cv::Range *)
Mat(const cv::Mat &, const std::vector<cv::Range,std::allocator<cv::Range>> &)
Mat(cv::Mat &&)
Mat(int, const int *, int, void *, const unsigned long int *)
Mat(const std::vector<int,std::allocator<int>> &, int, void *, const unsigned long int *)
Mat(const cv::cuda::GpuMat &)
'
推荐答案
这是Eclipse C ++解析器中的一个错误,归档为错误550397 。
This is a bug in Eclipse's C++ parser, filed as bug 550397.
更新:我也对此进行了修复。
UPDATE: I also have a fix for it.
这篇关于带有Mat分配的Eclipse CDT语法错误解析器错误:它可以编译并正常运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!