News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Graphics

Started by MarcIT, December 01, 2017, 01:22:28 PM

Previous topic - Next topic

MarcIT

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 :)

stahta01

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

nicol

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/