Unable to use graphic.h in c++ in visual studio
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.
2 Answers 2
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.
Name already in use
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
HOW TO SETUP VISUAL STUDIO COMMUNITY FOR GRAPHICAL PROGRAMMING IN C++ using Graphic.h
INTRODUCTION
Hello Everyone, Today we are going to set up Visual Studio Community Edition for Computer Graphical Programming using graphic.h in C++.
WHAT IS «graphic.h»
The graphics.h is a header file in C/C++ that provides access to a simple graphics library that makes it possible to draw lines, rectangles, ovals, arcs, polygons, images, and strings on a graphical window.
WHY YOU SHOULD USE «graphic.h»
In India, In The field of computer science, most of the degrees has at least Computer Graphical Programming course, be it B.Tech, BCA, BSc Cs, or any other degree in Computer science department.
So, if you are taking one of the courses listed above, it is mandatory to use graphic.h for Computer Graphical Programming.
WHY YOU SHOULDN’T USE «graphic.h»
graphics.h is for dos based graphics with max support of 640×480 resolution based on graphics driver and mode selection.
Because, “graphics.h” is really old library and not used anymore.
graphics.h is a 35 years old header that used to exist in Borland version of Turbo C. It is simply outdated & unsupported.
I would also suggest not to use Bloodshed Dev-C++ as it is also a quite outdated.
NOTE: If you are not taking any course that «Strictly» requires you to use graphic.h for Computer Graphical Programming, and just want to learn graphic programming in general or as a hobby we highly recommend that you use one of the many libraries out there which are better (but complicated) than graphics.h. Some of them are:
- OpenGL using GLFW (modern openGL)(Recommended)
OpenGL (Open Graphics Library) is a cross-language, cross-platform application programming interface (API) that use graphic hardware(GPU or Video card) for rendering 2D and 3D vector graphics.
- DirectX(Recommended)
DirectX is an application program interface (API) that use graphic hardware(GPU or Video card) for creating and managing graphic and multimedia effects in applications such as games or Dynamic Web pages that will run in MS’s Windows operating systems.
Latest DirectX 12 is included in Windows 10, 11
- SFML
Simple and Fast Multimedia Library (SFML) is a cross-platform software development library that use graphic hardware(GPU or Video card) it is designed to provide a simple application programming interface (API) to various multimedia components in Modern computers.
- SDL
SDL (Specification and Description Language) is a program design and implementation language that that use graphic hardware(GPU or Video card) for rendering 2D and 3D graphics. that is used to build actual-time event-driven systems that involve parallel processing
Note: you can setup graphic.h to work with both Visual studio Community/Professional and Visual Studio Code
STEP-BY-STEP INSTRUCTIONS
Step 1: First of all, for using «graphics.h» in the visual studio community, you should have Visual Studio Community installed in your computer. You can download its official version from Microsoft’s Visual studio website CLICK HERE
Step 2: Install Visual Studio Community as you would install any other setup. After installing Visual Studio Community, open Visual studio community installer by searching it in the start menu as shown in below screenshots
Step 3: Once Visual Studio Community Installer opens up click on modify to modify your installation.

Step 4: Choose The Highlighted workload below to download and install it in your Visual Studio Community Installation.

Step 5: After installing the workload, We would also need to download one more file that is WinBGIm Graphics Library for Visual Studio. Here BGI Stands for (Borland Graphics Interface) Click Here, download the “BGI2010.zip” File

Step 6: After downloading, right-click the file and select «Extract All» to unarchive the files in your desired path/directory.

The new directory will be created, named BGI, it has all necessary files that you will need (including the WinBGIm which contains graphic.h, winbgim.h and winbgi.h Libraries and a pre-set project that is already set up to you to test them) in order to create a computer graphics programs in Visual Studio community.

You should now rename of this folder to a name for your own liking that is easy to remember for you, such as “Graphical Programming Workspace”. And copy it to a easily accessible location such as your Document folder or your desktop.
Navigate to that directory. And you will see a bunch of files there which also include Graphics Library files and a sample project.
Step 7: In this folder, open the file named “bgi.vcxproj”. and the project will open in Visual Studio Community.

Step 8: As the Project opens you will see a prompt that asks you to retarget the Project to target the Latest Version of Visual Studio Community.
In this pop-up window choose the latest Windows SDK and Microsoft Platform Toolset version and click on the Ok Button as shown in below Screenshot.
And Visual Studio Community will Reconfigure the Project to target the Current Version of Visual studio community, Windows SDK and Platform Toolset version.

Step 9: In Visual Studio Community, Open** the solution explorer then open the source file and you will see a bunch of files there here create a new source code file(.cpp)


Step 10: Select C++ File (.cpp) File. Give the new file a name(we will use “Test”), and it will be added to your project.

Step 11: Now write this code in test.cpp and Save the file.
Step 12: Now build and run the Code by Clicking on Debug the click on Start without Debugger in drop down menu.

And you will see that your Program runs and a Circle is drawn on the console that opens up as shown in the screenshot.

Now, whenever you would need to write a new code just create a new file and write code in it and run just as we did for test.cpp
CONCLUSION
In this article we have learned How we can use graphic.h in Visual Studio Community which is a part of the Borland Graphics Interface.
This article is especially useful for College students who are taking a Computer Graphics Course.
I hope this article helped you, if you liked it please star this repo and share it with your friends.
About
Today we are going to set up Visual Studio Community Edition for Computer Graphical Programming using graphic.h in C++.
Русские Блоги

Способ 2: Найдите в визуальном каталоге «Включить, Lib» в каталоге установки Visual Studio, копирует копии двух файлов, которые распакованы.

Мой компьютер установлен по умолчанию, эти два каталогов здесь:
includeВнутри файлаСкопироватьмимо,libВнутри найденногоВерсия для корреспонденции x86, x64 Чтобы скопировать прошлое, если нет соответствующей версии, низкая версия должна иметь небольшие отношения. (Я использовал Visual Studio 2019 копий VS2017 Lib, может бежать)
Как подключить graphics h в visual studio 2019

Не подключается graphics.h в Visual Studio
Пишет:
‘HWND FindWindowW(LPCWSTR,LPCWSTR)’ : cannot convert argument 2 from ‘int’ to ‘LPCWSTR’
1> Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Сообщение было отмечено Master_Yi как решение
Не подключается graphics.h
При компиляции возникает ошибка, связанная с graphics.h. Подскажите, пожалуйста, как поступить? .
Не подключается инклуд graphics.h
Пишу программу с рисованием простых фигур на codeblocks последней версии. Но там в инклудах нет.
Как подключить graphics h в visual studio 2019
Setting up graphics library (graphics.h) in Visual Studio Code (c++)
Table Of Content
My Workspace Dir and code example

It like a tradition to use Turbo in our Indian CS sector. Its because the syllabus haven’t been changed since long time.
The graphics. h header file provides access to a simple graphics library that makes it possible to draw lines, rectangles, ovals, arcs, polygons, images, and strings on a graphical window. The second step is initialize the graphics drivers on the computer using initgraph method of graphics. h library.
- To know More Stanford !!old
<graphics.h> is very old library. It’s better to use something that is new.
Trust Me There are much better option
Allegro or SDL libraries may be for you. You could also try SFML. It has quite a following. You’ll have a large community behind you if you needed any help.
Now To set up graphics.h in vs code:
Get all the files needed graphics.h , winbgim.h and libbgi.a
If you don’t have MinGW installed get it from official and follow the steps.
Know the difference between MINGW, Mingw-w64 && TDM learn more go, go, go.
- Copy graphics.h and winbgim.h files to MinGW/ include folder.
location might be («C:\MinGW\include»)
- Copy libbgi.a to file to MinGW/ lib folder.
location might be («C:\MinGW\lib»)
Open Vs Code Smart way:
- Select a folder and open Terminal
if you are using template with task and c_cpp_properties json file then you directory should look like this:


Использование пользовательских CSS в Oracle ADF для достижения инверсии текста
Компьютерная фундамент | Bad_pool_Caller Синий экран Неисправность
Как использовать скрипт Python для анализа использования ЦП?
![]()
Используйте JSON AJAX, чтобы сделать кнопку Щелкнуть случайным образом отображать изображение и отобразить соответствующую — это первое изображение
m partroom package JSON.PAR.
![]()
Каковы компании, плагируемые Tencent? Пользовательское сообщение: Tencent без взрывоопасных моделей!
![]()
![]()
Седьмая статья в Mobile Mall [Запрос Товары, Страница Запрос, данные обратно]
Unable to use graphic.h in c++ in visual studio
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.
2 Answers 2
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.