title: Reasons for OpenCV imread to silently fail?
body: <p>I'm new to openCV and to C/C++ in general. I'm working on <a href="http://opencv-srf.blogspot.com/2013/06/load-display-image.html" rel="nofollow noreferrer">this</a> tutorial and using CMake to generate my makefiles. I have no problem building the first program (Read and Display), but when I run the executable, nothing happens and I must close out of my terminal because it just hangs. This happens even when I just use the following code:</p>
  
  <pre><code>#include "opencv2/highgui/highgui.hpp"
  #include "opencv2/core/core.hpp"
  #include &lt;iostream&gt;
  
  using namespace cv;
  using namespace std;
  
  int main( int argc, const char** argv )
  {
       cout &lt;&lt; "start\n";
       Mat img = imread("MyPic.jpg");
       return 0;
  }
  </code></pre>
  
  <p>When I delete <code>Mat img</code> line, "start" is outputted, but when I include it even that does not happen. MyPic.jpg is definitely in the same directory as the ReadDisplay.cpp and CMakeLists.txt. I am running Ubuntu 14.04. Finally, here is CMakeLists.txt:</p>
  
  <pre><code>cmake_minimum_required(VERSION 2.8)
  project( ReadDisplay )
  find_package( OpenCV REQUIRED )
  include_directories( ${OpenCV_INCLUDE_DIRS} )
  add_executable( ReadDisplay ReadDisplay.cpp )
  target_link_libraries( ReadDisplay ${OpenCV_LIBS} )
  </code></pre>
  
  <p>Any insights as to why this is causing issues?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>The above code was to explain how I was debugging and what was causing the problem; I've already tried catching the failure by checking image size and other methods to isolate it as a system/configuration issue. As per <a href="https://stackoverflow.com/questions/16109471/load-image-with-opencv-mat-c">this</a> post, I'm rebuilding openCV from source to see if that will fix anything.</p>