无法生成包含的 Open CV 标头的项目

  • 本文关键字:CV 项目 Open 包含 opencv
  • 更新时间 :
  • 英文 :


无法使用opencv库和标头构建项目。

其他包含目录 MVS

C:\OpenCV\build\install\include

在头文件中:

#include  < opencv2/core/core.hpp >
#include < opencv2/imgproc/imgproc.hpp >

构建输出

2>c:opencvbuildinstallincludeopencv2corecvdef.h(58): error C2059: syntax error: 'namespace'
2>c:opencvbuildinstallincludeopencv2corecvdef.h(58): error C2143: syntax error: missing ';' before '{'
2>c:opencvbuildinstallincludeopencv2corecvdef.h(58): error C2447: '{': missing function header (old-style formal list?)
2>c:opencvbuildinstallincludeopencv2coremat.hpp(437): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
2>c:opencvbuildinstallincludeopencv2coremat.hpp(437): error C2143: syntax error: missing ';' before '&'
2>c:opencvbuildinstallincludeopencv2coremat.hpp(437): error C2530: 'cv::InputArray': references must be initialized
2>c:opencvbuildinstallincludeopencv2coremat.hpp(438): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
2>c:opencvbuildinstallincludeopencv2coremat.hpp(438): error C2378: 'cv::InputArray': redefinition; symbol cannot be overloaded with a typedef
2>c:opencvbuildinstallincludeopencv2coremat.hpp(437): note: see declaration of 'cv::InputArray'
2>c:opencvbuildinstallincludeopencv2coremat.hpp(438): error C2146: syntax error: missing ';' before identifier 'InputArrayOfArrays'
2>c:opencvbuildinstallincludeopencv2coremat.hpp(439): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
2>c:opencvbuildinstallincludeopencv2coremat.hpp(439): error C2143: syntax error: missing ';' before '&'
2>c:opencvbuildinstallincludeopencv2coremat.hpp(439): error C2530: 'cv::OutputArray': references must be initialized
2>c:opencvbuildinstallincludeopencv2coremat.hpp(440): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
2>c:opencvbuildinstallincludeopencv2coremat.hpp(440): error C2378: 'cv::OutputArray': redefinition; symbol cannot be overloaded with a typedef
2>c:opencvbuildinstallincludeopencv2coremat.hpp(439): note: see declaration of 'cv::OutputArray'
2>c:opencvbuildinstallincludeopencv2coremat.hpp(440): error C2146: syntax error: missing ';' before identifier 'OutputArrayOfArrays'
2>c:opencvbuildinstallincludeopencv2coremat.hpp(441): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
2>c:opencvbuildinstallincludeopencv2coremat.hpp(441): error C2143: syntax error: missing ';' before '&'
2>c:opencvbuildinstallincludeopencv2coremat.hpp(441): error C2530: 'cv::InputOutputArray': references must be initialized
2>c:opencvbuildinstallincludeopencv2coremat.hpp(442): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
2>c:opencvbuildinstallincludeopencv2coremat.hpp(442): error C2378: 'cv::InputOutputArray': redefinition; symbol cannot be overloaded with a typedef
2>c:opencvbuildinstallincludeopencv2coremat.hpp(441): note: see declaration of 'cv::InputOutputArray'
2>c:opencvbuildinstallincludeopencv2coremat.hpp(442): error C2146: syntax error: missing ';' before identifier 'InputOutputArrayOfArrays'
2>c:opencvbuildinstallincludeopencv2coremat.hpp(444): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
2>c:opencvbuildinstallincludeopencv2coremat.hpp(444): error C2040: 'cv::InputOutputArray': 'int' differs in levels of indirection from 'int &'
2>c:opencvbuildinstallincludeopencv2coremat.hpp(444): error C2146: syntax error: missing ';' before identifier 'noArray'
2>c:opencvbuildinstallincludeopencv2coremat.hpp(1205): error C2061: syntax error: identifier 'OutputArray'
2>c:opencvbuildinstallincludeopencv2coremat.hpp(1213): error C2061: syntax error: identifier 'OutputArray'
2>c:opencvbuildinstallincludeopencv2coremat.hpp(1213): error C2535: 'void cv::Mat::copyTo(void) const': member function already defined or declared
2>c:opencvbuildinstallincludeopencv2coremat.hpp(1205): note: see declaration of 'cv::Mat::copyTo'
2>c:opencvbuildinstallincludeopencv2coremat.hpp(1228): error C2061: syntax error: identifier 'OutputArray'
2>c:opencvbuildinstallincludeopencv2coremat.hpp(1250): error C2061: syntax error: identifier 'InputArray'
2>c:opencvbuildinstallincludeopencv2coremat.hpp(1317): error C2061: syntax error: identifier 'InputArray'
2>c:opencvbuildinstallincludeopencv2coremat.hpp(1326): error C2061: syntax error: identifier 'InputArray'
2>c:opencvbuildinstallincludeopencv2coremat.hpp(1336): error C2061: syntax error: identifier 'InputArray'
2>c:opencvbuildinstallincludeopencv2coremat.hpp(2442): error C2061: syntax error: identifier 'OutputArray'
2>c:opencvbuildinstallincludeopencv2coremat.hpp(2444): error C2061: syntax error: identifier 'OutputArray'
2>c:opencvbuildinstallincludeopencv2coremat.hpp(2444): error C2535: 'void cv::UMat::copyTo(void) const': member function already defined or declared
2>c:opencvbuildinstallincludeopencv2coremat.hpp(2442): note: see declaration of 'cv::UMat::copyTo'
2>c:opencvbuildinstallincludeopencv2coremat.hpp(2446): error C2061: syntax error: identifier 'OutputArray'
2>c:opencvbuildinstallincludeopencv2coremat.hpp(2453): error C2061: syntax error: identifier 'InputArray'
2>c:opencvbuildinstallincludeopencv2coremat.hpp(2464): error C2061: syntax error: identifier 'InputArray'
2>c:opencvbuildinstallincludeopencv2coremat.hpp(2467): error C2061: syntax error: identifier 'InputArray'
2>c:opencvbuildinstallincludeopencv2coremat.inl.hpp(811): error C2660: 'cv::Mat::copyTo': function does not take 1 arguments
2>c:opencvbuildinstallincludeopencv2coremat.hpp(1205): note: see declaration of 'cv::Mat::copyTo'
2>c:opencvbuildinstallincludeopencv2coremat.inl.hpp(821): error C2660: 'cv::Mat::convertTo': function does not take 2 arguments
2>c:opencvbuildinstallincludeopencv2coremat.hpp(1228): note: see declaration of 'cv::Mat::convertTo'
2>c:opencvbuildinstallincludeopencv2coremat.inl.hpp(3748): error C2660: 'cv::UMat::copyTo': function does not take 1 arguments
2>c:opencvbuildinstallincludeopencv2coremat.hpp(2442): note: see declaration of 'cv::UMat::copyTo'
2>c:opencvbuildinstallincludeopencv2coremat.inl.hpp(3758): error C2660: 'cv::UMat::convertTo': function does not take 2 arguments
2>c:opencvbuildinstallincludeopencv2coremat.hpp(2446): note: see declaration of 'cv::UMat::convertTo'
2>c:opencvbuildinstallincludeopencv2core.hpp(308): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(348): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:opencvbuildinstallincludeopencv2core.hpp(388): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:opencvbuildinstallincludeopencv2core.hpp(413): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:opencvbuildinstallincludeopencv2core.hpp(441): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:opencvbuildinstallincludeopencv2core.hpp(445): error C2061: syntax error: identifier 'InputArray'
2>c:opencvbuildinstallincludeopencv2core.hpp(466): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:opencvbuildinstallincludeopencv2core.hpp(494): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:opencvbuildinstallincludeopencv2core.hpp(522): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(535): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(551): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(560): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(569): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(597): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(610): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(632): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(671): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:opencvbuildinstallincludeopencv2core.hpp(684): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:opencvbuildinstallincludeopencv2core.hpp(711): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:opencvbuildinstallincludeopencv2core.hpp(718): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:opencvbuildinstallincludeopencv2core.hpp(782): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(812): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(840): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(879): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(900): error C2061: syntax error: identifier 'OutputArray'
2>c:opencvbuildinstallincludeopencv2core.hpp(908): error C2146: syntax error: missing ')' before identifier 'mv'
2>c:opencvbuildinstallincludeopencv2core.hpp(931): error C2146: syntax error: missing ')' before identifier 'm'
2>c:opencvbuildinstallincludeopencv2core.hpp(991): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(1007): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(1016): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(1024): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(1058): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(1076): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(1091): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(1123): error C2061: syntax error: identifier 'OutputArray'
2>c:opencvbuildinstallincludeopencv2core.hpp(1144): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:opencvbuildinstallincludeopencv2core.hpp(1163): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(1185): error C2061: syntax error: identifier 'OutputArray'
2>c:opencvbuildinstallincludeopencv2core.hpp(1209): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:opencvbuildinstallincludeopencv2core.hpp(1227): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(1254): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:opencvbuildinstallincludeopencv2core.hpp(1281): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:opencvbuildinstallincludeopencv2core.hpp(1309): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:opencvbuildinstallincludeopencv2core.hpp(1326): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(1352): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:opencvbuildinstallincludeopencv2core.hpp(1364): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(1384): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(1413): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:opencvbuildinstallincludeopencv2core.hpp(1426): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:opencvbuildinstallincludeopencv2core.hpp(1447): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:opencvbuildinstallincludeopencv2core.hpp(1466): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(1491): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(1507): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(1520): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(1542): error C2146: syntax error: missing ')' before identifier 'magnitude'
2>c:opencvbuildinstallincludeopencv2core.hpp(1563): error C2146: syntax error: missing ')' before identifier 'x'
2>c:opencvbuildinstallincludeopencv2core.hpp(1583): error C2146: syntax error: missing ')' before identifier 'x'
2>c:opencvbuildinstallincludeopencv2core.hpp(1597): error C2146: syntax error: missing ')' before identifier 'x'
2>c:opencvbuildinstallincludeopencv2core.hpp(1614): error C2146: syntax error: missing ')' before identifier 'a'
2>c:opencvbuildinstallincludeopencv2core.hpp(1619): error C2146: syntax error: missing ')' before identifier 'a'
2>c:opencvbuildinstallincludeopencv2core.hpp(1649): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:opencvbuildinstallincludeopencv2core.hpp(1680): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(1693): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(1719): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(1746): error C2146: syntax error: missing ')' before identifier 'src'
2>c:opencvbuildinstallincludeopencv2core.hpp(1746): fatal error C1003: error count exceeds 100; stopping compilation

除了从头开始创建一个项目之外,没有什么帮助。不知何故,以前设置中的设置影响了正确构建。

就我而言,我的代码如下:

#include "some_my_own.h"
#include  <opencv2/core/core.hpp>

问题出在"some_my_own.h"中,它的牙套不正确。 我希望它能帮助某人,因为错误让我沮丧了很长时间。

最新更新