shivam
shivam

Reputation: 383

many undefined functions in opencv 3.0.0 using visual studio 2013

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;
}

enter image description here

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

Answers (3)

Madhumathi
Madhumathi

Reputation: 11

Clearly it has problem importing in that path. Try changing the path setting. Hope it helps.

Upvotes: 0

shivam
shivam

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

  1. Right click on cpp file and add new items.

  2. add property sheet here.

  3. 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

  1. right click and click add existing item.

  2. select the property sheet here and now the new project is linked with your opencv.

Thanks !

Upvotes: 0

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

Related Questions