Author Topic: Graphics  (Read 9325 times)

MarcIT

  • Guest
Graphics
« on: December 01, 2017, 01:22:28 pm »
Hi! I want to debug a project with graphics.h header but I still getting the error "has stopped working". I've downloaded graphics,winbgim, libbgi.a and I pasted them into include/ subdirectory and lib/. I modified graphics.h at line 302 and I add at linker settings in codeblocks all which I need. But I don't know how to initialize that BGI drawing window. How can I do that?  :) and I use Code::Blocks 13.12 ! Sorry for my english if I had mistakes!  ;) My code is simple:

#include <graphics.h>

using namespace std;

int main()
{
    initwindow(400, 300, "Windows BGI");
    line(0, 0, 100, 100);
    getch();
    closegraph();
    return 0;
}

Sorry for copy-paste :)
« Last Edit: December 01, 2017, 04:43:56 pm by MarcIT »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline nicol

  • Single posting newcomer
  • *
  • Posts: 2
Re: Graphics
« Reply #2 on: May 13, 2020, 06:48:14 am »
You can refer this article for a clear understanding for including graphics.h in codeblocks https://erainnovator.com/how-to-include-graphics-h-in-codeblocks/