title: QNativeImage: Unable to attach to shared memory segment.
body: <p>I saw there is one same thread: <a href="https://stackoverflow.com/questions/22606144/opencv-error-in-c-wrapper-for-imread-qnativeimage-unable-to-attach-to-shared-m">OpenCv Error in C Wrapper for imread: QNativeImage: Unable to attach to shared memory segment</a>     That thread was posted about 4 months ago. No any answer. So I re-post one. </p>
  
  <p>I ran this code on eclipse luna on ubuntu14.04. </p>
  
  <pre><code>#include &lt;iostream&gt;
  
  #include &lt;opencv2/opencv.hpp&gt;
  
  using namespace std;
  using namespace cv;
  
  int main(int argc, char* argv[])
  {
      Mat img = imread("/home/tqjustc/Pictures/2.jpg", CV_LOAD_IMAGE_COLOR);
      imshow("opencvtest", img);
      waitKey(0);
      return 0;
  }
  </code></pre>
  
  <p>But there is an error. </p>
  
  <pre><code>init done 
  opengl support available 
  QNativeImage: Unable to attach to shared memory segment. 
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  QNativeImage: Unable to attach to shared memory segment. 
  X Error: BadDrawable (invalid Pixmap or Window parameter) 9
    Major opcode: 62 (X_CopyArea)
    Resource id:  0x0
  </code></pre>
  
  <p>Can any one help solve this problem ? </p>