Code::Blocks Forums

User forums => Help => Topic started by: MarcIT on December 01, 2017, 01:22:28 pm

Title: Graphics
Post by: MarcIT 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 :)
Title: Re: Graphics
Post by: stahta01 on December 01, 2017, 06:15:18 pm
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F (http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F)
Title: Re: Graphics
Post by: nicol 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/