veera - 2022-06-08

I am trying to Install the Free Image library in C++ using Dev- Cpp on Windows 10, I put the .h files in the corresponding folder and added the directories in Dev-CPP, DLL file I put in the folder:* C:\Program Files (x86)\Dev-Cpp\MinGW64*bin that it's where I have installed Dev-Cpp, also a .lib file I put it in the next folder: C:\Program Files(x86)\Dev-Cpp\MinGW64\lib that also it's where I have installed Dev-Cpp, I added -l Free Image to the linker too.

when I compile the code, the .h files are found correctly, but Dev-Cpp gives me errors of type Undefined reference, I understand this is because C++ can't see where it's the functions defined.

#include <iostream>
#include <FreeImagePlus.h>

int main(){
    fipImage img;
    img.load("Goten.jpg");


    return 0;
}

Errors:

C:\Users\admin\AppData\Local\Temp\ccjljTTu.o    Aburrido2.cpp:(.text+0x36): undefined reference to `__imp__ZN8fipImageC1E15FREE_IMAGE_TYPEjjj'
C:\Users\admin\AppData\Local\Temp\ccjljTTu.o    Aburrido2.cpp:(.text+0x53): undefined reference to `__imp__ZN8fipImage4loadEPKci'
C:\Users\admin\AppData\Local\Temp\ccjljTTu.o    Aburrido2.cpp:(.text+0x68): undefined reference to `__imp__ZN8fipImageD1Ev'
C:\Users\admin\AppData\Local\Temp\ccjljTTu.o    Aburrido2.cpp:(.text+0x7f): undefined reference to `__imp__ZN8fipImageD1Ev'
C:\Users\admin\Desktop\Programacion\collect2.exe    [Error] ld returned 1 exit status

Linker:

-static-libgcc  -lFreeImage 

What i need to do? - Sorry for my english.

 

Last edit: Logan Abbott 2023-09-15