I've been looking for a somewhat simple library to read an image's pixels for a school project and after looking around i stumbled upon CImg, but after trying some code i found i only get the same error. Code:
#include <iostream>
using namespace std;
#include <CImg.h>
using namespace cimg_library;
int main(){
    CImg<unsigned char> src("test.png");
    int width = src.width();
    int height = src.height();
    cout << width << "x" << height << endl;
    for (int r = 0; r < height; r++)
        for (int c = 0; c < width; c++)
            cout << "(" << r << "," << c << ") ="
                 << " R" << (int)src(c,r,0,0)
                 << " G" << (int)src(c,r,0,1)
                 << " B" << (int)src(c,r,0,2) << endl;
    return 0;
}
Which gives this error:
/usr/bin/ld: main.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
../../bmptk/Makefile.inc:1342: recipe for target 'main.exe' failed
make: *** [main.exe] Error 1
Can anyone explain to me what i'm doing wrong or what i can do to avoid this error?
Edit: added makefile
# source files in this project (main.cpp is automatically assumed)
SOURCES := 
# header files in this project
HEADERS := 
# other places to look for files for this project
SEARCH  := 
# set RELATIVE to the next higher directory 
# and defer to the Makefile.* there
RELATIVE := ..
include $(RELATIVE)/Makefile.native
