User forums > Help
Trying to install graphics.h but getting "cannot find -lbgi" error
nenin:
--- Quote from: imranif on February 07, 2025, 07:50:00 am ---Umm, i didn't understand what you meant. Could you explain a little bit? What 64 bit library should i install?
--- End quote ---
This library is too old in all meanings.
If you want to use it you have to find sources and rebuild it with you version of the wingw compiler. It may not works, or requires some additional efforts, if it was coded in low standard levels.
There is another version: https://openbgi.sourceforge.net/ - also very old.
Please note that actually it is from 80th. https://en.wikipedia.org/wiki/Borland_Graphics_Interface
It is too old for practical usage or for the learning.
PS. https://github.com/ahmedshakill/WinBGIm-64 - 64b version, should be more or less fresh.
Evan:
I'm not using Window anymore, but here is my notes for w7 and it still works fine for me:
graphics.h
Global compiler settings/Toolchain executables:
Compiler's installation directory:
C:\TDM-GCC-32
Program Files:
C compiler: : g++.exe
C++ compiler : g++.exe
Linker dynamic libs: g++.exe
linker static libs : ar.exe
Debugger : GDC/CDB debugger: Default
Resource compiler : windres.exe
Make program : mingw32-make.exe
Compiler's installation directory:
C:\TDM-GCC-32
Linker settings:
//-lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32
C:\TDM-GCC-32\lib\libbgi.a
C:\TDM-GCC-32\lib\libgdi32.a
C:\TDM-GCC-32\lib\libcomdlg32.a
C:\TDM-GCC-32\lib\libuuid.a
C:\TDM-GCC-32\lib\liboleaut32.a
C:\TDM-GCC-32\lib\libole32.a
Debugger:
C:\TDM-GCC-32\gdb32\bin\gdb32.exe
#include <graphics.h>
int main() {
initwindow(640, 480, "Graphics test", 0, 300);
int x1 = 100, y1 = 200, x2 = 500, y2 = 400;
moveto(x1, y1);
lineto(x1, y2);
lineto(x2, y2);
lineto(x2, y1);
lineto(x1, y1);
getchar();
return 0;
}
Navigation
[0] Message Index
[*] Previous page
Go to full version