Reputation: 13
Okay so I needed to create a project in c++ which involves using multiples straight lines in the output.So I searched through everything and thought of using graphic.h. But it doesn't work in Visual Studio 2019 so I somehow downloaded graphic.h but i'm still not able to run my program for idk what reasons. So is there an easy way to do this?I just need to have a bunch of straight lines and maybe a little bit of color too.
Upvotes: 0
Views: 21090
Reputation: 109
Actually you can use graphics.h
on the lastest version of Visual Studio
graphics.h
and graphics.lib
files in https://github.com/ahuynh359/GraphicsProject1
I will add these two files to Project1\Project1
Properties
choose Configuration Manager
change to x86
and Win32
#include "graphics.h"
#pragma comment(lib,"graphics.lib")
int main()
{
initwindow(500, 500);
getch();
closegraph();
return 0;
}
Upvotes: 0
Reputation: 31447
graphics.h is a non-standard header that's only available with the Turbo C / Turbo C++ compilers from Borland. Those products have been obsolete for ~25 years and should not be used today.
In addition, any code that uses graphics.h will only work on old DOS systems (and old windows systems that ran on top of DOS or included a DOS subsystem). Modern Linux and Windows systems won't work with code based on graphics h
You should switch to a more modern graphics library like SFML or SDL or a number of other options. Learning / using graphics.h in 2020 is just wasting your time - noone uses that any more and it doesn't even work on modern systems.
Upvotes: 6