'FLTK Cannot open "image.jpg"

I'm making a program on fltk for a uni cpp project and I need to be able to attach an image to an open window. However when the window opens I get the text of "cannot open "(respective image name).jpg(or gif)".My headers/cmake lists are correct and I tried sending the exact same code to a friend that has the same project where he didn't have a problem and attached the image correctly. Here is the respective code:

#include "Simple_window.h" 
#include "Graph.h"        

int main(){
    using namespace Graph_lib;
    Simple_window win(Point(0, 0), 600, 400, "Canvas");
    Image img(Point(100, 100), "image.jpg"); 
    win.attach(img);
    win.wait_for_button();
}

And here is the output

WIndow Output

Also here are the files

files



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source