title: CImg save_jpeg() does not work
body: <p>I have a problem with CImg. I want to convert .bmp file to .jpg one. </p>
  
  <pre><code>#include "CImg.h"
  using namespace cimg_library;
  (...)
  CImg&lt;unsigned char&gt; image("image.bmp");
  image.save_jpeg("image.jpg", 60);
  </code></pre>
  
  <p>When I want to run this program, sometimes it return an error:
  <a href="https://i.stack.imgur.com/AgCT8.png" rel="nofollow noreferrer">CImag error</a></p>
  
  <p>Sometimes it did not appear, but also did not create .jpg file.</p>
  
  <p>I want to add, that another CImg functions works properly, like turning photo to a grayscale.</p>
  
  <p>Could you please tell me what is wrong with this code? Maybe it is another possible way to convert and save photo into .jpg file?</p>
  
  <p>EDIT:
  When I add </p>
  
  <pre><code>#define cimg_use_jpeg
  </code></pre>
  
  <p>before </p>
  
  <pre><code>#include &lt;CImg.h&gt;
  </code></pre>
  
  <p>I got a lot of errors regarding cimg.h <a href="https://i.stack.imgur.com/zf3ZH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zf3ZH.png" alt="error"></a></p>