title: OpenCv undefined reference to `cv::
body: <p>I am new at OpenCv. I am using Eclipse C/C++. When i try to run this sample code i faced with these errors. What should i do to solve this problem? Is there any problem at configurating ?</p>
  
  <pre><code>#using namespace std;
  #using namespace cv;
  
      int main( int argc, const char** argv )
      {
           Mat img = imread("MyPic.JPG", CV_LOAD_IMAGE_UNCHANGED); 
           if (img.empty()) //check whether the image is loaded or not
           {
                cout &lt;&lt; "Error : Image cannot be loaded..!!" &lt;&lt; endl;
                //system("pause"); //wait for a key press
                return -1;
           }
           namedWindow("MyWindow", CV_WINDOW_AUTOSIZE); //create a window with the name "MyWindow"
           imshow("MyWindow", img); /
           waitKey(0); //wait infinite time for a keypress
           destroyWindow("MyWindow"); //destroy the window with the name, "MyWindow"
  
           return 0;
      }
  
  
  16:11:28 **** Incremental Build of configuration Debug for project OpenCv ****
  Info: Internal Builder is used for build
  g++ "-IC:\\opencv\\build\\include" -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\OpenCv.o" "..\\src\\OpenCv.cpp" 
  g++ "-LC:\\opencv\\build\\x86\\vc12\\lib" -o OpenCv.exe "src\\OpenCv.o" -lopencv_calib3d249 -lopencv_contrib249 -lopencv_core249 -lopencv_features2d249 -lopencv_flann249 -lopencv_gpu249 -lopencv_highgui249 -lopencv_imgproc249 -lopencv_legacy249 -lopencv_ml249 -lopencv_nonfree249 -lopencv_objdetect249 -lopencv_ocl249 -lopencv_photo249 -lopencv_stitching249 -lopencv_superres249 -lopencv_ts249 -lopencv_video249 -lopencv_videostab249 
  src\OpenCv.o: In function `main':
  C:\Users\ayberk101\workspace\OpenCv\Debug/../src/OpenCv.cpp:10: undefined reference to `cv::imread(std::string const&amp;, int)'
  C:\Users\ayberk101\workspace\OpenCv\Debug/../src/OpenCv.cpp:19: undefined reference to `cv::namedWindow(std::string const&amp;, int)'
  C:\Users\ayberk101\workspace\OpenCv\Debug/../src/OpenCv.cpp:20: undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&amp;)'
  C:\Users\ayberk101\workspace\OpenCv\Debug/../src/OpenCv.cpp:20: undefined reference to `cv::imshow(std::string const&amp;, cv::_InputArray const&amp;)'
  C:\Users\ayberk101\workspace\OpenCv\Debug/../src/OpenCv.cpp:22: undefined reference to `cv::waitKey(int)'
  C:\Users\ayberk101\workspace\OpenCv\Debug/../src/OpenCv.cpp:24: undefined reference to `cv::destroyWindow(std::string const&amp;)'
  src\OpenCv.o: In function `ZN2cv3MatD1Ev':
  C:/opencv/build/include/opencv2/core/mat.hpp:278: undefined reference to `cv::fastFree(void*)'
  src\OpenCv.o: In function `ZN2cv3Mat7releaseEv':
  C:/opencv/build/include/opencv2/core/mat.hpp:367: undefined reference to `cv::Mat::deallocate()'
  collect2.exe: error: ld returned 1 exit status
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/CSz85.png" alt="enter image description here"></p>