Undefined reference to "readimagefile" to add image to window while using WinBGI graphics library on dev C++

61 views Asked by At

I have a hangman game project using graphics. And, I am trying to add image to the windows, but I get the error of

Untitled1.cpp:(.text+0x72): undefined reference to `readimagefile'

#include <iostream>
#include<graphics.h>
#include<conio.h>

using namespace std;

// Loading Game

int main()

{
    
    initwindow(600,600, "Hello");
    readimagefile("hangmanLogo.png", 0,0,100,42);

    settextstyle(10, 0, 2);
    setbkcolor(7);
    settextstyle(10, 0, 7);
    outtextxy(170,200, "H_ngm_n");  
    rectangle(260,298,340,308);
    setcolor(YELLOW);

    for(int i=0;i<=76;i++)

    {
        line(262+i,300,262+i,306);
        delay(70);
    }
    
    cleardevice();

return 0;
}

The code runs fine without the readimagefile function. But when I use this, I get this error. I've included the header file of graphics.h. I've also linked the following. -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32.

0

There are 0 answers