I have just started learning programming, and I am facing troubles adding libraries ( Other than STD libraries) in my programs. I use codeblocks IDE and I wanted to add a library CImg from the internet.
After reading many threads I have done the following steps however I still get an error loading one of the examples provided CImg people
The cimg.h file open up and I get the following error:
||=== Build file: "no target" in "no project" (compiler: unknown) ===|
E:\programming\cpp programming\CImg-2.0.0_pre012317\CImg.h||In function 'int cimg_library::cimg::fseek(FILE*, INT_PTR, int)':|
E:\programming\cpp programming\CImg-2.0.0_pre012317\CImg.h|5617|error: '_fseeki64' was not declared in this scope|
E:\programming\cpp programming\CImg-2.0.0_pre012317\CImg.h||In function 'INT_PTR cimg_library::cimg::ftell(FILE*)':|
E:\programming\cpp programming\CImg-2.0.0_pre012317\CImg.h|5626|error: '_ftelli64' was not declared in this scope|
||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 10 second(s)) ===|
Please help me out, Also kindly explain to me what I am doing as I have no idea.
EDIT: As pointed out to me in the comments I have changed my compiler to TDM-GCC MinGW 64 bit compiler. But now I get a different type of error, is it because I havent installed the compiler properly because I can run hello world using this compiler. the error that i get is :
||=== Build: Debug in hello (compiler: GNU GCC Compiler) ===| obj\\Debug\\main.o||In function
cimg_library::CImgDisplay::paint()':| E:\\programming\\cpp programming\\hello\\..\\CImg-2.0.0_pre012317\\CImg.h|9696|undefined reference to
cimg_library::CImgDisplay::paint()':| E:\\programming\\cpp programming\\hello\\..\\CImg-2.0.0_pre012317\\CImg.h|9696|undefined reference to
__imp_SetDIBitsToDevice'| ||error: ld returned 1 exit status| ||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
Finally I have found out what were my mistakes and how to correct them.
Thank you for helping me out.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.