cannot open source file

asked 2015-10-14 08:56:59 -0600

hajnis gravatar image

updated 2018-01-21 00:23:07 -0600

Hello there, I followed tutorial in On you pages "Installation by Using the Pre-built Libraries". Then I tried this simple cout function:

#include <opencv2\opencv.hpp>
#include <iostream>

using namespace std;

void main()
{
    cout << "OpenCV Version: " << CV_VERSION << endl;
}

When debugging, VS 2013 throw me this errors: image description

I also folowed tutorial on Youtube which I think is the same as first tutorial.

Can anyone help me figure out this problem? Thanks much

edit retag flag offensive close merge delete

Comments

2

You may have correctly installed OpenCV, but I am betting you didn't configure Visual Studio. Check this guide: http://docs.opencv.org/master/d6/d8a/...

LorenaGdL gravatar imageLorenaGdL ( 2015-10-14 09:14:51 -0600 )edit

Yes, this is tutorial i followed. Dont know where the problem is

hajnis gravatar imagehajnis ( 2015-10-14 10:03:16 -0600 )edit

@hajnis please notice that I linked a different tutorial from the one you pointed out. Have you configured your own Property Sheets in VS?

LorenaGdL gravatar imageLorenaGdL ( 2015-10-14 10:08:45 -0600 )edit

Yes, the first tutorial lead me to tutorial you posted first time. This is all steps i went threw:

  1. I downloaded OpenCV
  2. Extracted OpenCV to C: folder
  3. Created Windows System variable OPENCV_DIR with value c:\opencv\build\x86\vc12
  4. Edited path value, added %OPENCV_DIR%\bin
  5. In VS 2013 property manager created OpenCV_Debug and Release settings
  6. c/c++/General/Additional Include Directories added "f$(OPENCV_DIR)....\include;"
  7. Linker/GeneralAdditional Library Directories added "$(OPENCV_DIR)\lib;"
  8. Linker\Input\Additional Dependencies added "opencv_ts300d.lib;opencv_world300d.lib;"(in release its without d)

Can you find some bad steps here? Thank you.

hajnis gravatar imagehajnis ( 2015-10-14 12:50:52 -0600 )edit

On step 6 is that a copy-paste of what you have? Because there should be no 'f' at the front and it should be "....\include" rather than "....\include"

Brandon212 gravatar imageBrandon212 ( 2015-10-14 14:24:22 -0600 )edit

first time i Had it withouf "f", then i discovered thet there is "f" in tutorial so i put it there and with that include as you can see it automaticaly erase backslash here :)

hajnis gravatar imagehajnis ( 2015-10-14 14:53:53 -0600 )edit
2

I'd use full paths to every folder if it's your first time, even without any system variable. Once you have everything working, you can replace expressions and see what works and what does not, and track down all possible errors

LorenaGdL gravatar imageLorenaGdL ( 2015-10-14 15:06:34 -0600 )edit