如果我尝试使用graphics.h for c / c ++时,如果code :: blocks显示错误,我该怎么办? [英] What can I do if code::blocks shows error when I try to use graphics.h for c/c++?

查看:149
本文介绍了如果我尝试使用graphics.h for c / c ++时,如果code :: blocks显示错误,我该怎么办?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天我试着在code :: blocks中使用graphics.h编写代码。但不是显示适当的结果,而是显示没有这样的文件或目录。但是,是不是graphics.h是c / c ++的头文件之一?所以,如果有任何解决方案,告诉我该怎么做,以便我可以在code :: blocks中使用它。或者,如果你有其他更好的替代想法,这是值得赞赏的。

解决方案

Graphics.h不是一个部分的标准C ++。它是大约30年前Borland C起源的Borland图形库的主标题。它已经过时了大约20年。

C ++没有正式认识到像素的存在,所以你需要一个外部库来做图形。这对我来说是违反规则的,所以不要告诉任何人,但是查看SDL。 a>


Today I tried to write a code using graphics.h in code::blocks. But instead of showing appropriate result, it showed "no such file or directory". But, isn't graphics.h is one of the header file of c/c++? So, if there is any solution, tell me what to do so that I can use it in code::blocks. Or, if you have any other better substitutive idea, it is sure to be appreciated.

解决方案

Graphics.h is not a part of Standard C++. It is the main header for the Borland Graphics Library that originated with Borland C about 30 years ago. It has been obsolete for about 20 years.

C++ doesn't officially recognize the existence of pixels, so you need an external library to do graphics. It's against the rules to for me to do this, so don't tell anyone, but take a look at SDL.

这篇关于如果我尝试使用graphics.h for c / c ++时,如果code :: blocks显示错误,我该怎么办?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆