Problem with CImg

Today I started working with CImg or at least I tried, because when I try to compile the code I get an error from the CImg.h file.

CImg.h|8446|undefined reference to `SetDIBitsToDevice@48'|

My code's here:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream>
#include "CImg.h"
using namespace std;
using namespace cimg_library;

int main() {
    CImg<unsigned char> image("image.jpg"), visu(500,400,1,3,0);
    const unsigned char red[] = { 255,0,0 }, green[] = { 0,255,0 }, blue[] = { 0,0,255 };
    image.blur(2.5);
    CImgDisplay main_disp(image,"Click a point"), draw_disp(visu,"Intensity profile");
    while (!main_disp.is_closed() && !draw_disp.is_closed()) {
        main_disp.wait();
        if (main_disp.button() && main_disp.mouse_y()>=0) {
            const int y = main_disp.mouse_y();
            visu.fill(0).draw_graph(image.get_crop(0,y,0,0,image.width()-1,y,0,0),red,1,1,0,255,0);
            visu.draw_graph(image.get_crop(0,y,0,1,image.width()-1,y,0,1),green,1,1,0,255,0);
            visu.draw_graph(image.get_crop(0,y,0,2,image.width()-1,y,0,2),blue,1,1,0,255,0).display(draw_disp);
        }
    }
    return 0;
}


Im working on code::blocks, Windows 7.
If anyone knows how to solve please reply, I don't know how to fix it.
About undefined reference http://www.cplusplus.com/forum/general/113904/#msg622060
So you'll need to figure out what library defines that `SetDIBitsToDevice' symbol


Inside the `CImg-1.5.9/resources/' directory there are some example build scripts
They add {user,gdi,shell}32.lib
Topic archived. No new replies allowed.