编译private.hpp OpenCV 3.0.0-rc1时出错
Error compiling private.hpp OpenCV 3.0.0-rc1
我下载了OpenCV 3.0.0-rc1并使用CMAKE-gui 3.2.2使用VS2012 Win64编译器构建它。生成了二进制文件和库,我用64位Qt设置了它。所有程序都工作正常,除了当我尝试使用功能cv::LineSegmentDetector
时,它在private.hpp文件中显示编译错误。错误提示
unexpected end-of-line
我的代码如下
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgcodecs/imgcodecs.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/core/private.hpp>
#include <opencv2/core/utility.hpp>
using namespace std;
int main()
{
cv::Mat image = cv::imread("C:\Users\IMAGE\Desktop\PROJ\SAMPLE.png");
cv::imshow("TEST",image);
cv::waitKey();
cv::LineSegmentDetector lsd;
return 0;
}
并且在错误之后,我发现private.hpp中以下部分代码的第二行作为错误突出显示。
#ifdef HAVE_EIGEN
# if defined __GNUC__ && defined __APPLE__
# pragma GCC diagnostic ignored "-Wshadow"
# endif
# include <Eigen/Core>
# include "opencv2/core/eigen.hpp"
#endif
# if define &&定义__APPLE__
请让我知道,如果我正在做一些实现错误或在私有的一些变化。hpp可以修复这个错误。我用的是windows 8 64位。
哦,永远不要尝试使用所谓的"private",我猜…
#include <opencv2/opencv.hpp> // includes all others
#include <opencv2/core/utility.hpp> // getTickCount, etc.
int main()
{
// LineSegmentDetector is an abstract class, you can't create an
// instance on the stack, but need to use Ptr and factory:
cv::Ptr<cv::LineSegmentDetector> lsd = cv::createLineSegmentDetector();
return 0;
}
相关文章:
- 访问者访问变体并返回不同类型时出错
- 在Linux for Windows上编译C++代码时出错
- 读取文件的最后一行并输入到链接列表时出错
- 重载操作程序时出错>>用于类中的字符串 memebr
- 调用专用模板时出错"no matching function for call to [...]"
- C++-试图将函数指针推回到另一个CPP文件中的矢量时出错
- LINK 尝试使用 OpenSSL evp aes 256 c++ 时出错
- 在Google Kick start中提交时出错
- 在c++中访问int到类对象的映射时出错
- 分段错误当我试图运行程序时出错
- 使用dynamic_cast和构造函数时出错
- CHECK(调用)函数在Google Colab中出错
- 用pybind11包装C++抽象类时出错
- 为x86而非x64编译时出错
- 从R调用C++函数并对其进行集成时出错
- 这个函数哪里出错了
- C++ 创建包含链表和字符串的对象的链接列表时出错
- 为重写std::exception的库生成swig接口时出错
- 导入/导出变量时出错
- 编译private.hpp OpenCV 3.0.0-rc1时出错