Skip to content

Anandesh-Sharma/Use-Graphics.h-in-Atom-CodeBlocks-and-DevC-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Use-Graphics.h-in-Atom-CodeBlocks-and-DevC-

How to use graphics.h in latest IDE's & Editors 2018

Just Follow the Steps for CODE::BLOCKS :-

  1. Clone the files from this repository. And download the Code::Blocks.
  2. Now copy the graphics.h & winbgim.h header files in C:\Program Files\CodeBlocks\MinGW\include directory.
  3. Now copy the libbgi.a library file in C:\Program Files\CodeBlocks\MinGW\lib directory.

Note: It may possible that your codeblocks installation is in another folder like Program Files(x86) by default codeblocks is installed in this directory. So find your path accordingly.

  1. Now open your codeblocks and go to Settings > Compiler Settings > Linker Settings. Click on Add to link libraries and browse your libbgi.a library file; should be like C:\Program Files\CodeBlocks\MinGW\lib\libbgi.a.

  2. In Linker Settings paste these linkers in Other linker options.

     -lbgi
     -lgdi32
     -lcomdlg32
     -luuid
     -loleaut32
     -lole32
    
  3. Cheers 🎉 🤘 Now run any graphics program. Remember that your program should be like name_of_file.cpp. Because C doesn't support sstream.

For Dev C++ you have to do the same upto Linker step. You need to add linkers with the project, just paste the linkers in Project Options > Parameters > Linkers. Or You can do it every project by pasting it in Tools > Compiler Options > General > in second textbox

Just Follow the Steps for Atom :-

  1. Clone the files from this repository. And download the Atom.
  2. Download the GCC compiler MinGW. And install it. Mark all options for installation.
  3. Set the path for the compiler. Go to Control Panel > System > Advanced System Settings > Environment Variables > Path > Edit > New > paste C:\MinGW\bin
  4. Now open the Atom and install a package gpp-compiler from press (ctrl + comma) it'll open settings > Install.
  5. After that paste those linkers, go to Open settings > Packages > Settings of gpp-compiler package > C++ Compiler Options.
  6. Done! Create new file and press f5 to run the program.

Graphics in Linux Ubuntu/Mint/Fedora

  1. First Download the suitable binary file, according to your Linux OS The current release of SDL_bgi is 2.2.3. To compile it from sources, you will need a compiler (gcc or clang are fine), make, and SDL2. On Debian and Ubuntu-like distributions, you will need the package 'libsdl2-dev' and its dependencies.

Building has been tested on GNU/Linux Mint 18.*, Fedora 26, Windows (MSYS2 + mingw-w64, Code::Blocks, Dev-C++ ), and Mac OS X Yosemite.

  1. To compile a program using SDL_bgi, make sure that it includes the 'graphics.h' header file. Then:

    gcc -o program program.c -lSDL_bgi -lSDL2

  2. If you want to integrate this with your favourite editors the simply add linker.

    -lSDL_bgi -lSDL2

About

How to use graphics.h in latest IDE's & Editors 2018

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages