Graphics.h error

Hello, i have got a little problem, or more precisely a big problem :). When i include the library graphics.h every thing goes perfect until I use command initwindow();. When the program reaches this command instead opening the graphics window it crashes. Does anybody know what to do with this pleas?

1
2
3
4
5
6
7
8
9
10
11
  #include <iostream>
#include <graphics.h>

using namespace std;

int main()
{
    initwindow(1600,900);
    getch();
    return 0;
}
I tried to change the window largeness and update codeblocks and redownload library from another site.
Is there a reason you're using this ancient library instead of something much better and newer like SFML, QT, SDL etc?

Edit: What kind of crash error are you getting?

Edit 2: Most likely scenario is that you didn't install the library correctly.
Last edited on
reason is because we have to use it in school and error is the program stopped working.

I installed it exactly how it is on the guide and how it works my friends and in school.
Last edited on
I tried to change the window largeness and update codeblocks and redownload library from another site.

What site?

Also what operating system and version are you using?

What compiler and version are you using at home.

What compiler and version are you using at school.

When i include the library graphics.h

Actually graphics.h is not a library, it is an include file. Are you sure that you're properly adding the library to your project?

You really should try to come into this century with a more modern graphics package as already mentioned and if that is not possible then unless the "graphics" are absolutely required you would probably be better off sticking with console applications.

Also since this is a very old and outdated graphics system you would probably be better off asking your instructors and perhaps your classmates for support.

Last edited on
@TarikNeaj && @jlb
Please stop. It gets very old constantly reading people harp on users based upon their requirements instead of simply helping with the problem. Accept that BGI graphics are still used and move on. OP does not need your clutter. OP needs help solving his problem.

@kubax03
The best suggestion is to ask your professor for help...

However, it might be worth checking the following issues:

If you are using Borland's compiler:

    • Make sure that the egavga.bgm file is in the same directory as your .exe file.

    • Also make sure that you are running your program in a context where it can be used.
      What that means is, if you are on any modern Windows OS, make sure you are running
      the program with DOSBox (http://www.dosbox.com/).

If you are using MinGW with WinBGIm:

    • Make sure you have your library directories set-up so that it can link properly.

[edit]
    • Make sure that your GCC version is the same as the one that was used to compile the WinBGIm library.
      I forgot this one, but it is important, and it is most likely the reason you are having problems. 
      What version of GCC are you using?
[/edit]

Hope this helps.
Last edited on
There's a lot of people who choose the wrong/old things simply because they are unaware, stop being butthurt about me simply asking a question. It might get old for you to see it, but since the question is being asked once to different people only the argument that it get's old is nonsensical. In this case OP did not need our "clutter", but in other cases they do.

LOL.

No, please. Continue on in your self-assured righteousness.


I love it when some "butthurt" loser online gets offended enough to start arguing logical fallacies about who is "butthurt". Wanna play?

Go ahead. Prove to me you're big enough not to still be offended. I assure you I'm enjoying this.


 
Good Rule Of Thumb To Not Be A Jerk On The Internet

1. Don't assume people asking questions are so ignorant that they don't know that they really don't want to be using the technology that they are asking questions about.

2. Don't be offended when someone points out that you are violating 1 



The old BGI library this is a non-issue because the only people still using it are:
1) hobbyists, who know enough about the library that they don't need to post on cpp.com about initwindow(), and
2) students who are required to use it in their beginner's classes.
1. Don't assume people asking questions are so ignorant that they don't know that they really don't want to be using the technology that they are asking questions about.

Ehh, what assumption? Is asking a question on why they're using something outdated considered an assumption now? You might want to look up the definition of assumption.

Ive met a lot of people that didn't realize that they could be using a better tool for their needs, which then went on to appreciating the fact that that was pointed out to them.

I also didn't know you were so triggered by the word "butthurt". I guess you learn something new everday.

Edit:
And we're both adults here, so let's put this past us now. I'll continue doing what I think is right, and if you want to continue telling me to stop be my guest =)
Last edited on
reason is because we have to use it in school


Is there anything unclear about it. ???
Seems pretty clear to me, that's why I didn't post anything after I read that.

Edit: To clarify:
If I'm breaking this websites rule by simply asking a question about the tool he is using, please tell me so I can apologize and stop doing that. But If what Im doing is simply not liked by someone, or breaks their personal rule of thumb, then I couldnt care less to be honest.
Last edited on
@TarikNeaj,

I don't think that you are breaking any rules, but your answer/question had nothing to do with the question/problem he is having.

Imagine that you have a problem with your landline phone and instead solving the actual problem the mechanic tells you to get a smart phone instead. If you want your landline repaired you don't want to hear about smart phones.
@Thomas1965. That is a ridiculous comparison. Programming is hard to get into, and there are lots of bad tutorials and information out there, many people learn and use the wrong tools unknowingly. Asking to make sure is not a bad thing, it's a good thing, and it is not the same as telling someone to get a smart phone. Everyone knows about smartphones, there is almost no point in asking "You do know there are smartphones out there". But like I stated earlier, a lot of people Ive spoken to did not know there were better tools out there to fit their needs, so if Im going to continue to ask that question, even if it's just that one out of 100 person that happens to benefit from it. It's a simple question and one can choose to answer it or not.

Edit: And also as I stated before, I would love if we could put this past us and stop talking about it. Let this post be the last about this subject.
Last edited on
Topic archived. No new replies allowed.