title: imwrite throwing compile error in OpenCV
body: <p>I have been using OpenCV for a while and also the <code>imwrite</code> function, but unfortunately this is not working any more.</p>
  
  <p>I am running with OpenCV 2.4.3 with following sample code:</p>
  
  <pre><code>imwrite("somepath/somefile.png", myMat);
  </code></pre>
  
  <p>The error:</p>
  
  <pre><code>Undefined symbols for architecture x86_64:
  "cv::imwrite(std::string const&amp;, cv::_InputArray const&amp;, std::__debug::vector&lt;int,     std::allocator&lt;int&gt; &gt; const&amp;)", referenced from:
  MyProject::this_callback(int, void*) in MyProject.o
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>
  
  <p>The error looks somewhat familiar but i cannot determine whats wrong.</p>
  
  <p><img src="https://i.stack.imgur.com/KTpYb.png" alt="enter image description here"></p>