Reputation: 383
I have just started out to learn opencv but facing many issues. i have installed opencv and linked it to visual studio 2013.
My first program which i copied from a video worked fine, which was
#include <cstdio>
#include <opencv2\opencv.hpp>
void main()
{
std::cout << "OpenCV Version: " << CV_VERSION << std::endl;
}
after this i created anew project and imported all the settings of the first project through import export settings option, but while compiling only it is showing many errors
#include <opencv/cv.h>
#include <opencv/highhui.h>
using namespace std;
using namespace cv;
int main(void)
{
Mat img = imread("C:/Users/shivamkumar07/Documents/Visual Studio 2013/Projects/ConsoleApplication2/shape.jpg");
imshow("inputfile", img);
img.release();
waitKey();
cvDestroyAllWindows();
return 0;
}
i am not able to understand why this is happening, please help me i am a beginner in this and not much tutorials are available on opencv 3.0.0
Thanks in advance!!
Upvotes: 0
Views: 956
Reputation: 11
Clearly it has problem importing in that path. Try changing the path setting. Hope it helps.
Upvotes: 0
Reputation: 383
After going through lots of stuff, i found out that i had not properly linked my opencv with this new project. That's why there were many undefined functions in my new project.
A better way to do this by using "Property sheet", once a property sheet is saved then it can be used in all of the new projects which you want.
steps to create Property Sheet
Right click on cpp file and add new items.
add property sheet here.
link opencv with your project by adding all the directories and lib files both in Release and Debug and save it by giving it some name.
steps to copy property sheet in new project
right click and click add existing item.
select the property sheet here and now the new project is linked with your opencv.
Thanks !
Upvotes: 0
Reputation: 1460
The first error is pretty clear, the compiler cannot find the file "opencv/cv.h" you included.
Try adding the correct folder to the include directories in the project settings.
Upvotes: 1