0

I am trying to load an jpeg image with Cimg. But I have the problem exposed: Cannot load any image with CImg.

So I have followed carefully the different answers written by Mark Setchell and Draex_.

But I still have a problem : when I compile my Cimg program I have the next errors:

 - E1696    cannot open source file "jpeglib.h"     
 - C1083    Cannot open include file: 'jpeglib.h': No such file or directory    
Asier Gomez
  • 6,034
  • 18
  • 52
  • 105
  • The accepted answer looks pretty sufficient. Did you install the `libjpeg` as it told you to do? – drescherjm May 06 '19 at 14:20
  • Possible duplicate of [Cannot load any image with CImg](https://stackoverflow.com/questions/46055720/cannot-load-any-image-with-cimg) – drescherjm May 06 '19 at 14:20
  • If you did as the answer of @Draex you made a mistake at step 11. This is also step 10 of the accepted answer. – drescherjm May 06 '19 at 14:21
  • @drescherjm Indeed, I have followed all the step of Draex_ but when I've seen that it didn't work, I have completed with the step 10 of MarkSetchell. – Maxime Vacher May 06 '19 at 14:47
  • @AlexF Yes I have this directory but it doesn't contains "jpeglib.h" ! ".../jpeg-9b/Release" contains only "jpeg.lib" and others files "_.obj" that I don't understand. "jpeglib.h" is in ".../jpeg-9b" with a bunch of others files. – Maxime Vacher May 06 '19 at 14:47
  • You have to investigate that step again. Verify that the folder you added indeed contains `jpeglib.h` your compiler is telling you `jpeglib.h` does not exist in any folder listed in the include directories. Perhaps you did not apply the Additional Include Directories to all configurations (Release, Debug ...)? The setting defaults to apply to only the selected configuration. – drescherjm May 06 '19 at 14:48
  • `.../jpeg-9b/Release` is not the correct folder you needed to type in the `Additional Include Directories` also be careful you may have different libraries for Debug and Release and need to set the library paths separately for each configuration. – drescherjm May 06 '19 at 14:59
  • @drescherjm I'm a beginner in C ++, so I don't understand everything, so sorry ! Why did you say that there is a mistake in the step 11 of Draex ? – Maxime Vacher May 06 '19 at 15:12
  • The mistake is you typed the wrong folder in step 11 of Draex or 10 of Mark Setchell's answer. – drescherjm May 06 '19 at 15:13
  • @drescherjm Well, I don't know where I'm wrong. I have followed the steps of Draex: I created the same folders with the same names, I placed them correctly in the folder of my project as he said, I have the same files in ../ IncludedLibraries / jpeglib except "vc141.pdb. I'm so confused why it doesn't work while it seems to work for Draex. Can this come from the header file location "Cimg.h" ? I put it in the project folder but I don't know.... – Maxime Vacher May 06 '19 at 15:43
  • Maybe you did not separate the paths in the `Additional Include Directories` using a `;` – drescherjm May 06 '19 at 16:12
  • Maybe you want to try using an absolute path instead of a relative path? – drescherjm May 06 '19 at 16:16

0 Answers0