title: OpenCV won't compile due to unresolved externals -- LNK2019
body: <p>I am brand new to OpenCV and have been trying to set it up in Visual Studios 2010 Ultimate. I have followed the documentation exactly, and linked the files as it said. Here are the additional libraries that I am using:</p>
  
  <pre><code>opencv_core231d.lib
  opencv_imgproc231d.lib
  opencv_highgui231d.lib
  opencv_ml231d.lib
  opencv_video231d.lib
  opencv_features2d231d.lib
  opencv_calib3d231d.lib
  opencv_objdetect231d.lib
  opencv_contrib231d.lib
  opencv_legacy231d.lib
  opencv_flann231d.lib
  </code></pre>
  
  <p>And all of their Release counterparts. However, when I try to debug &amp; compile the sample code given to me, I get the following errors. (I read somewhere that you have to compile and publish the project in order for it to work properly? Is that true as well?)</p>
  
  <pre><code>1&gt;------ Build started: Project: openCVTest, Configuration: Debug Win32 ------
  1&gt;Build started 5/6/2012 10:39:03 AM.
  1&gt;InitializeBuildStatus:
  1&gt;  Touching "Debug\openCVTest.unsuccessfulbuild".
  1&gt;ClCompile:
  1&gt;  All outputs are up-to-date.
  1&gt;ManifestResourceCompile:
  1&gt;  All outputs are up-to-date.
  1&gt;openCVTest.obj : error LNK2019: unresolved external symbol _cvWaitKey referenced in function _main
  1&gt;openCVTest.obj : error LNK2019: unresolved external symbol "void __cdecl cv::imshow(class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; const &amp;,class cv::_InputArray const &amp;)" (?imshow@cv@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV_InputArray@1@@Z) referenced in function _main
  1&gt;openCVTest.obj : error LNK2019: unresolved external symbol "public: __thiscall cv::_InputArray::_InputArray(class cv::Mat const &amp;)" (??0_InputArray@cv@@QAE@ABVMat@1@@Z) referenced in function _main
  1&gt;openCVTest.obj : error LNK2019: unresolved external symbol _cvMoveWindow referenced in function _main
  1&gt;openCVTest.obj : error LNK2019: unresolved external symbol "void __cdecl cv::namedWindow(class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; const &amp;,int)" (?namedWindow@cv@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z) referenced in function _main
  1&gt;openCVTest.obj : error LNK2019: unresolved external symbol "public: virtual double __thiscall cv::VideoCapture::get(int)" (?get@VideoCapture@cv@@UAENH@Z) referenced in function _main
  1&gt;openCVTest.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall cv::VideoCapture::~VideoCapture(void)" (??1VideoCapture@cv@@UAE@XZ) referenced in function _main
  1&gt;openCVTest.obj : error LNK2019: unresolved external symbol "public: virtual bool __thiscall cv::VideoCapture::isOpened(void)const " (?isOpened@VideoCapture@cv@@UBE_NXZ) referenced in function _main
  1&gt;openCVTest.obj : error LNK2019: unresolved external symbol "public: __thiscall cv::VideoCapture::VideoCapture(class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; const &amp;)" (??0VideoCapture@cv@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function _main
  1&gt;openCVTest.obj : error LNK2019: unresolved external symbol "void __cdecl cv::fastFree(void *)" (?fastFree@cv@@YAXPAX@Z) referenced in function "public: __thiscall cv::Mat::~Mat(void)" (??1Mat@cv@@QAE@XZ)
  1&gt;openCVTest.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::Mat::deallocate(void)" (?deallocate@Mat@cv@@QAEXXZ) referenced in function "public: void __thiscall cv::Mat::release(void)" (?release@Mat@cv@@QAEXXZ)
  1&gt;openCVTest.obj : error LNK2019: unresolved external symbol "class cv::Scalar_&lt;double&gt; __cdecl cv::sum(class cv::_InputArray const &amp;)" (?sum@cv@@YA?AV?$Scalar_@N@1@ABV_InputArray@1@@Z) referenced in function "double __cdecl getPSNR(class cv::Mat const &amp;,class cv::Mat const &amp;)" (?getPSNR@@YANABVMat@cv@@0@Z)
  1&gt;openCVTest.obj : error LNK2019: unresolved external symbol "public: class cv::MatExpr __thiscall cv::Mat::mul(class cv::_InputArray const &amp;,double)const " (?mul@Mat@cv@@QBE?AVMatExpr@2@ABV_InputArray@2@N@Z) referenced in function "double __cdecl getPSNR(class cv::Mat const &amp;,class cv::Mat const &amp;)" (?getPSNR@@YANABVMat@cv@@0@Z)
  1&gt;openCVTest.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::Mat::convertTo(class cv::_OutputArray const &amp;,int,double,double)const " (?convertTo@Mat@cv@@QBEXABV_OutputArray@2@HNN@Z) referenced in function "double __cdecl getPSNR(class cv::Mat const &amp;,class cv::Mat const &amp;)" (?getPSNR@@YANABVMat@cv@@0@Z)
  1&gt;openCVTest.obj : error LNK2019: unresolved external symbol "void __cdecl cv::absdiff(class cv::_InputArray const &amp;,class cv::_InputArray const &amp;,class cv::_OutputArray const &amp;)" (?absdiff@cv@@YAXABV_InputArray@1@0ABV_OutputArray@1@@Z) referenced in function "double __cdecl getPSNR(class cv::Mat const &amp;,class cv::Mat const &amp;)" (?getPSNR@@YANABVMat@cv@@0@Z)
  1&gt;openCVTest.obj : error LNK2019: unresolved external symbol "public: __thiscall cv::_OutputArray::_OutputArray(class cv::Mat &amp;)" (??0_OutputArray@cv@@QAE@AAVMat@1@@Z) referenced in function "double __cdecl getPSNR(class cv::Mat const &amp;,class cv::Mat const &amp;)" (?getPSNR@@YANABVMat@cv@@0@Z)
  1&gt;openCVTest.obj : error LNK2019: unresolved external symbol "class cv::Scalar_&lt;double&gt; __cdecl cv::mean(class cv::_InputArray const &amp;,class cv::_InputArray const &amp;)" (?mean@cv@@YA?AV?$Scalar_@N@1@ABV_InputArray@1@0@Z) referenced in function "class cv::Scalar_&lt;double&gt; __cdecl getMSSIM(class cv::Mat const &amp;,class cv::Mat const &amp;)" (?getMSSIM@@YA?AV?$Scalar_@N@cv@@ABVMat@2@0@Z)
  1&gt;openCVTest.obj : error LNK2019: unresolved external symbol "class cv::_OutputArray const &amp; __cdecl cv::noArray(void)" (?noArray@cv@@YAABV_OutputArray@1@XZ) referenced in function "class cv::Scalar_&lt;double&gt; __cdecl getMSSIM(class cv::Mat const &amp;,class cv::Mat const &amp;)" (?getMSSIM@@YA?AV?$Scalar_@N@cv@@ABVMat@2@0@Z)
  1&gt;openCVTest.obj : error LNK2019: unresolved external symbol "void __cdecl cv::divide(class cv::_InputArray const &amp;,class cv::_InputArray const &amp;,class cv::_OutputArray const &amp;,double,int)" (?divide@cv@@YAXABV_InputArray@1@0ABV_OutputArray@1@NH@Z) referenced in function "class cv::Scalar_&lt;double&gt; __cdecl getMSSIM(class cv::Mat const &amp;,class cv::Mat const &amp;)" (?getMSSIM@@YA?AV?$Scalar_@N@cv@@ABVMat@2@0@Z)
  1&gt;openCVTest.obj : error LNK2019: unresolved external symbol "class cv::MatExpr __cdecl cv::operator+(class cv::Mat const &amp;,class cv::Mat const &amp;)" (??Hcv@@YA?AVMatExpr@0@ABVMat@0@0@Z) referenced in function "class cv::Scalar_&lt;double&gt; __cdecl getMSSIM(class cv::Mat const &amp;,class cv::Mat const &amp;)" (?getMSSIM@@YA?AV?$Scalar_@N@cv@@ABVMat@2@0@Z)
  1&gt;openCVTest.obj : error LNK2019: unresolved external symbol "class cv::MatExpr __cdecl cv::operator+(class cv::MatExpr const &amp;,class cv::Scalar_&lt;double&gt; const &amp;)" (??Hcv@@YA?AVMatExpr@0@ABV10@ABV?$Scalar_@N@0@@Z) referenced in function "class cv::Scalar_&lt;double&gt; __cdecl getMSSIM(class cv::Mat const &amp;,class cv::Mat const &amp;)" (?getMSSIM@@YA?AV?$Scalar_@N@cv@@ABVMat@2@0@Z)
  1&gt;openCVTest.obj : error LNK2019: unresolved external symbol "class cv::MatExpr __cdecl cv::operator*(double,class cv::Mat const &amp;)" (??Dcv@@YA?AVMatExpr@0@NABVMat@0@@Z) referenced in function "class cv::Scalar_&lt;double&gt; __cdecl getMSSIM(class cv::Mat const &amp;,class cv::Mat const &amp;)" (?getMSSIM@@YA?AV?$Scalar_@N@cv@@ABVMat@2@0@Z)
  1&gt;openCVTest.obj : error LNK2019: unresolved external symbol "void __cdecl cv::GaussianBlur(class cv::_InputArray const &amp;,class cv::_OutputArray const &amp;,class cv::Size_&lt;int&gt;,double,double,int)" (?GaussianBlur@cv@@YAXABV_InputArray@1@ABV_OutputArray@1@V?$Size_@H@1@NNH@Z) referenced in function "class cv::Scalar_&lt;double&gt; __cdecl getMSSIM(class cv::Mat const &amp;,class cv::Mat const &amp;)" (?getMSSIM@@YA?AV?$Scalar_@N@cv@@ABVMat@2@0@Z)
  1&gt;openCVTest.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::Mat::copySize(class cv::Mat const &amp;)" (?copySize@Mat@cv@@QAEXABV12@@Z) referenced in function "public: __thiscall cv::Mat::Mat(class cv::Mat const &amp;)" (??0Mat@cv@@QAE@ABV01@@Z)
  1&gt;openCVTest.obj : error LNK2019: unresolved external symbol "void __cdecl cv::subtract(class cv::_InputArray const &amp;,class cv::_InputArray const &amp;,class cv::_OutputArray const &amp;,class cv::_InputArray const &amp;,int)" (?subtract@cv@@YAXABV_InputArray@1@0ABV_OutputArray@1@0H@Z) referenced in function "class cv::Mat &amp; __cdecl cv::operator-=(class cv::Mat const &amp;,class cv::Mat const &amp;)" (??Zcv@@YAAAVMat@0@ABV10@0@Z)
  1&gt;C:\Users\Logan\documents\visual studio 2010\Projects\openCVTest\Debug\openCVTest.exe : fatal error LNK1120: 25 unresolved externals
  1&gt;
  1&gt;Build FAILED.
  1&gt;
  1&gt;Time Elapsed 00:00:00.40
  ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  </code></pre>
  
  <p>I went through all my directories and made sure that the libraries, did in fact, exist in my OpenCV files, and my download didn't corrupt or anything. Any help would be appreciated!</p>
  
  <p>-Logantf17</p>