Hello,Recently I’ve downloaded Code::Blocks because I’d like to make projects that are open and multi platform. I want to make a very simple program that uses the C image liberary CImg.
The whole library is included in a single header called :CImg.h”. I’ve included this in the same folder as my project I wish to work on. I have also included the header file in my source code for the project.
The minimum code contained in my main.cpp file looks like this:
#include"CImg.h"usingnamespace cimg_library;int main(){constunsignedchar purple[]={255,0,255};CImg<unsignedchar>(640,400,1,3,0).draw_text(100,100,"Hello World",purple).display("My first CImg code");return0;}
Upon compiling I get the following errors:
obj\Release\main.o:main.cpp||undefined reference to `SetDIBitsToDevice@48'|
obj\Release\main.o:main.cpp|| undefined reference to `SetDIBitsToDevice@48'|
obj\Release\main.o:main.cpp|| undefined reference to `SetDIBitsToDevice@48'|
obj\Release\main.o:main.cpp||undefined reference to `SetDIBitsToDevice@48'|
obj\Release\main.o:main.cpp|| undefined reference to `SetDIBitsToDevice@48'|
obj\Release\main.o:main.cpp|| more undefined references to `SetDIBitsToDevice@48' follow|||===Build finished:6 errors,0 warnings ===|
I’m not used to really working much with external dependencies with Code::Blocks and I’ve not ventured beyond playing with SFML (which I got working following a tutorial).
I’m working on Windows 7 at the moment if that is of any help. I’m not advanced with C++ but I have an understanding of the core library. Adding dependent libraries is really a headache it seems…