I'm trying to make CImg work with Visual Sudio 2017 and jpeg-9b but for some reason it doesn't.
Code:
#define cimg_use_jpeg
#include "../CImg/CImg.h"
using namespace cimg_library;
#pragma comment(lib, "libjpeg.a")
CImg<unsigned char> image("../images/img.jpg"), visu(500, 400, 1, 3, 0);
The first step is the build of the library, where I followed a description how to use the MinGW compiler. Even if the build succeeds, the generated library
libjpeg.a
is not linkable in the Visual Studio solution. Error Message:
State Error LNK2019 unresolved external symbol __imp___iob referenced in function _output_message
Another generated library libjpeg.dll.a throws an error when loading a .jpg file CImg Exception (picture)
After a couple of rebuilds the issue still exists.
I also tried to use the VC compiler, but I cannot find the needed win32.mak file which is required when calling the build comand nmake -f makefile.vc setup-v10
. Unofficial downloads of this file don't work properly on my pc. The generated solution cannot be opened in Visual Studio.
Is there maybe some workaround - if there is not a solution?