1
votes

Alright, So here is the simple code, [Error Snapshot and Output Log at the bottom]

Update: I have already changed the library names (Debug+Release) from 248 to 2413)

Update2: Turning On: Configuration Properties -> C/C++ -> Preprocessor -> Preprocess to a File changes the error to LNK1104 error>Line 1.

#include<opencv2\highgui\highgui.hpp>
#include<iostream>
using namespace std;
using namespace cv;
int main(void)
{
       Mat frame;
       frame=imread("room.jpg",CV_LOAD_IMAGE_UNCHANGED);
       while (waitKey(30)!=27) //27 is ascii equivalent of esc key
       {
              imshow("Image", frame); //loop line 1
       }
}

Here are my OpenCV configuration settings I used for Visual Studio 2012 that I followed from this tutorial (https://www.youtube.com/watch?v=v-VgWxkVp2w)


  1. Download OpenCV 2.4.8 ( but I'm using version 2413]

  2. Create a Win32 console application

  3. Config opencv.. 3.1. Menu Project ---- $ProjectName Properties

3.2. Choose Configuration Manager... and add x64 platform

3.3. At configuration field, choose All configuration 3.3.1. At Configuration Properties ---- C/C++ ---- Additional Include Directories, add opencv include folders

$opencv\build\include
$opencv\build\opencv
$opencv\build\opencv2 

NOTE: $opencv is a folder that you have installed opencv

3.3.2. At Configuration Properties ---- Linker ---- Additional Library Directories, add opencv library folder $opencv\build\x64\vc11\lib

3.4. At configuration field, choose Debug mode 3.4.1. At Configuration Properties ---- Linker ---- Additional dependencies ----

add dependence libraries opencv_stitching248d.lib opencv_contrib248d.lib opencv_videostab248d.lib opencv_superres248d.lib opencv_nonfree248d.lib opencv_gpu248d.lib opencv_ocl248d.lib opencv_legacy248d.lib opencv_ts248d.lib opencv_calib3d248d.lib opencv_features2d248d.lib opencv_objdetect248d.lib opencv_highgui248d.lib opencv_video248d.lib opencv_photo248d.lib opencv_imgproc248d.lib opencv_flann248d.lib opencv_ml248d.lib opencv_core248d.lib

NOTE: These file above are located at .\opencv\build\x64\vc11\lib\

3.5. At configuration field, choose Release mode 3.5.1. At Configuration Properties ---- Linker ---- Additional dependencies ---- add dependence libraries opencv_stitching248.lib opencv_contrib248.lib opencv_videostab248.lib opencv_superres248.lib opencv_nonfree248.lib opencv_gpu248.lib opencv_ocl248.lib opencv_legacy248.lib opencv_ts248.lib opencv_calib3d248.lib opencv_features2d248.lib opencv_objdetect248.lib opencv_highgui248.lib opencv_video248.lib opencv_photo248.lib opencv_imgproc248.lib opencv_flann248.lib opencv_ml248.lib opencv_core248.lib NOTE: These file above are located at .\opencv\build\x64\vc11\lib\

3.6. Add $opencv\build\x64\v11\bin to System Environment Path 3.7. Restart Visual studio


So previously it was working with VC11, then I included imgproc in my code, and ever since this error doesn't seem to go away. I even tried using VC12.

Why I am seeing this error, I'm not even using imgproc in my code?

Yes, I have been a good sport and I searched like 20-25 related posts but in vain. So I really need an expert's advice, who can be a beginner in this, because as you can see from the code I am completely new to OpenCV.

Thanks in advance people.


OutPut:

1>------ Build started: Project: OpenCV2, Configuration: Debug x64 ------ 1> Source.cpp 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(141): error C2146: syntax error : missing ';' before identifier 'ksize' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(141): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(142): error C2146: syntax error : missing ';' before identifier 'anchor' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(142): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(224): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(224): error C2143: syntax error : missing ',' before '<' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(234): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(234): error C2143: syntax error : missing ',' before '<' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(241): error C2061: syntax error : identifier 'Size' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(243): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(243): error C2143: syntax error : missing ',' before '&' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(249): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(249): error C2143: syntax error : missing ',' before '&' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(260): error C2146: syntax error : missing ';' before identifier 'ksize' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(260): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(261): error C2146: syntax error : missing ';' before identifier 'anchor' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(261): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(263): error C2146: syntax error : missing ';' before identifier 'wholeSize' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(263): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(264): error C2146: syntax error : missing ';' before identifier 'roi' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(264): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(267): error C2143: syntax error : missing ';' before '<' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(267): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(267): error C2238: unexpected token(s) preceding ';' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(269): error C2143: syntax error : missing ';' before '<' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(269): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(269): error C2238: unexpected token(s) preceding ';' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(270): error C2143: syntax error : missing ';' before '<' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(270): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(270): error C2238: unexpected token(s) preceding ';' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(271): error C2143: syntax error : missing ';' before '<' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(271): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(271): error C2238: unexpected token(s) preceding ';' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(272): error C2143: syntax error : missing ';' before '<' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(272): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(272): error C2238: unexpected token(s) preceding ';' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(274): error C2143: syntax error : missing ';' before '<' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(274): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(274): error C2238: unexpected token(s) preceding ';' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(276): error C2143: syntax error : missing ';' before '<' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(276): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(276): error C2238: unexpected token(s) preceding ';' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(277): error C2143: syntax error : missing ';' before '<' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(277): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(277): error C2238: unexpected token(s) preceding ';' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(278): error C2143: syntax error : missing ';' before '<' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(278): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(278): error C2238: unexpected token(s) preceding ';' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(254): error C2065: 'filter2D' : undeclared identifier 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(286): error C2065: 'InputArray' : undeclared identifier 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(286): error C2146: syntax error : missing ')' before identifier 'kernel' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(286): error C2059: syntax error : ')' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(289): error C2143: syntax error : missing ';' before '<' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(289): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(294): error C2143: syntax error : missing ';' before '<' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(294): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(294): error C2086: 'int cv::Ptr' : redefinition 1> D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(289) : see declaration of 'cv::Ptr' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(300): error C2143: syntax error : missing ';' before '<' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(300): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(300): error C2086: 'int cv::Ptr' : redefinition 1> D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(289) : see declaration of 'cv::Ptr' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(306): error C2143: syntax error : missing ';' before '<' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(306): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(306): error C2086: 'int cv::Ptr' : redefinition 1> D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(289) : see declaration of 'cv::Ptr' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(314): error C2143: syntax error : missing ';' before '<' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(314): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(314): error C2086: 'int cv::Ptr' : redefinition 1> D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(289) : see declaration of 'cv::Ptr' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(320): error C2146: syntax error : missing ';' before identifier 'getGaussianKernel' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(320): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(323): error C2143: syntax error : missing ';' before '<' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(323): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(323): error C2086: 'int cv::Ptr' : redefinition 1> D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(289) : see declaration of 'cv::Ptr' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(327): error C2065: 'OutputArray' : undeclared identifier 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(327): error C2146: syntax error : missing ')' before identifier 'kx' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(327): error C2182: 'getDerivKernels' : illegal use of type 'void' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(329): error C2059: syntax error : ')' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(331): error C2143: syntax error : missing ';' before '<' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(331): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(331): error C2086: 'int cv::Ptr' : redefinition 1> D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(289) : see declaration of 'cv::Ptr' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(335): error C2143: syntax error : missing ';' before '<' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(335): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(335): error C2086: 'int cv::Ptr' : redefinition 1> D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(289) : see declaration of 'cv::Ptr' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(338): error C2143: syntax error : missing ';' before '<' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(338): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(338): error C2086: 'int cv::Ptr' : redefinition 1> D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(289) : see declaration of 'cv::Ptr' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(342): error C2143: syntax error : missing ';' before '<' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(342): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(342): error C2086: 'int cv::Ptr' : redefinition 1> D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(289) : see declaration of 'cv::Ptr' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(348): error C2146: syntax error : missing ';' before identifier 'getGaborKernel' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(348): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(348): error C2086: 'int cv::Mat' : redefinition 1> D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(320) : see declaration of 'cv::Mat' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(348): error C2065: 'Size' : undeclared identifier 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(348): error C2146: syntax error : missing ')' before identifier 'ksize' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(349): error C2059: syntax error : ')' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(358): error C2143: syntax error : missing ';' before '<' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(358): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(358): error C2086: 'int cv::Ptr' : redefinition 1> D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(289) : see declaration of 'cv::Ptr' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(360): error C2143: syntax error : missing ';' before '<' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(360): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(360): error C2086: 'int cv::Ptr' : redefinition 1> D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(289) : see declaration of 'cv::Ptr' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(362): error C2143: syntax error : missing ';' before '<' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(362): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(362): error C2086: 'int cv::Ptr' : redefinition 1> D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(289) : see declaration of 'cv::Ptr' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(366): error C2146: syntax error : missing ';' before identifier 'morphologyDefaultBorderValue' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(366): error C2433: 'Scalar' : 'inline' not permitted on data declarations 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(366): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(366): error C2825: 'cv::Scalar': must be a class or namespace when followed by '::' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(366): error C2039: 'all' : is not a member of 'global namespace'' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(366): error C2146: syntax error : missing ';' before identifier 'all' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(366): error C3861: 'all': identifier not found 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(369): error C2143: syntax error : missing ';' before '<' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(369): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(369): error C2086: 'int cv::Ptr' : redefinition 1> D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(289) : see declaration of 'cv::Ptr' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(377): error C2146: syntax error : missing ';' before identifier 'getStructuringElement' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(377): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(377): error C2086: 'int cv::Mat' : redefinition 1> D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(320) : see declaration of 'cv::Mat' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(377): error C2061: syntax error : identifier 'Size' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(379): error C2143: syntax error : missing ';' before '<' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(379): error C2182: 'Ptr' : illegal use of type 'void' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(379): error C2086: 'int cv::Ptr' : redefinition 1> D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(289) : see declaration of 'cv::Ptr' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(379): error C2988: unrecognizable template declaration/definition 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(379): error C2059: syntax error : '<' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(379): error C2039: 'delete_obj' : is not a member of 'global namespace'' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(387): error C2065: 'InputArray' : undeclared identifier 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(387): error C2146: syntax error : missing ')' before identifier 'src' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(387): error C2182: 'medianBlur' : illegal use of type 'void' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(387): error C2059: syntax error : ')' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(389): error C2065: 'InputArray' : undeclared identifier 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(389): error C2146: syntax error : missing ')' before identifier 'src' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(389): error C2182: 'GaussianBlur' : illegal use of type 'void' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(392): error C2059: syntax error : ')' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(394): error C2065: 'InputArray' : undeclared identifier 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(394): error C2146: syntax error : missing ')' before identifier 'src' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(394): error C2182: 'bilateralFilter' : illegal use of type 'void' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(396): error C2059: syntax error : ')' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(398): error C2065: 'InputArray' : undeclared identifier 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(398): error C2146: syntax error : missing ')' before identifier 'src' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(398): error C2182: 'adaptiveBilateralFilter' : illegal use of type 'void' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(400): error C2059: syntax error : ')' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(400): fatal error C1003: error count exceeds 100; stopping compilation ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


ERROR SCREENSHOT

2
"Download OpenCV 2.4.8 ( but I'm using version 2413]" -- HUH?Dan Mašek
Anything man, I'm willing to try it cause I'm new. But how does that justify that my OpenCV 2.4.1.3 version initially worked?WikiMalik
#include <opencv2/opencv.hpp>Miki
Should the version number even make a difference here? I just opened the download page for OpenCV opencv.org/downloads.html and v2.4.8 is nowhere to be found. What should I do now?WikiMalik
@DanMašek I appreciate your comment, please help me get there.WikiMalik

2 Answers

1
votes

It's a compiler error (not a linker error) so it should have to do with the header files, I guess. Haven't you installed different versions of OpenCV on the same place? That would mix up the things. Try delete all the opencv files and start over again.

1
votes

In project options (3.3) you only need the following additional include:

$opencv\build\include

D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(141): error C2146: syntax error : missing ';' before identifier 'ksize' 1>D:\OpenCV\opencv\build\include\opencv2\imgproc\imgproc.hpp(141): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

Error caused by missed declaration of Size which is declared in "opencv2/core/core.hpp" header. Other types like InputArray, OutputArray also declared there. core.hpp is included together with #include <opencv2\highgui\highgui.hpp>. Check that core.hpp is not broken (e.g. not empty).

If you use Visual Studio 2012 Ultimate you can generate include graph and check where imgproc.hpp included. For the program above it should looks like on the picture bellow:

enter image description here

As you can see, imgproc.hpp header is not included automatically. To fix the error you should find where imgproc.hpp is included. I suggest to check the preprocessor output for the Source.cpp file. To do it follow the instructions here. Look through the result Source.i file and find where imgproc.hpp included.

UPDATE:

In your Source.i the following lines includes imgproc.hpp:

#line 2 "d:\\program files (x86)\\microsoft visual studio 11.0\\vc\\include\\iosfwd"
#line 1 "d:\\opencv\\opencv\\build\\include\\opencv2\\imgproc\\imgproc.hpp"

these lines come from the standard headers includes in #include "opencv2/core/core.hpp". I don't know why this random header included there.

It looks like there is a magic to disable standard headers include. Define SKIP_INCLUDES in your preprocessor definitions. In Solution Explorer opens Project Properties -> C\C++ -> Preprocessor -> Preprocessor Definitions and add SKIP_INCLUDES there.