---
title: "C语言中的graphics.h问题"
author: "易水侠客"
date: "2013-07-06T14:34:42Z"
tags: []
categories: ["编程语言"]
slug: "c-graphics-h"
draft: false
lastmod: "2013-07-06T14:34:42Z"
id: 1900520
url: "https://shadowwalker.iteye.com/blog/1900520"
---

如果头文件有这个，#include &lt;graphics.h&gt;，编译时会显示  
 Cannot open include file: 'graphics.h': No such file or directory

VC 绘图库(**下载**[graphics.h](http://files.cnblogs.com/emanlee/CProgram_graphics_h_VC_BGI-20090909.zip "CProgram_graphics_h_VC_BGI-20090909.zip"))：可以在 VC 下像 Turbo C 的 BGI 一样简单的绘图

**安装**   
下载的压缩包里除了说明，只有两个主要文件，将 graphics.lib 拷贝到 VC6 文件夹下的 Lib 文件夹内，将 graphics.h 拷贝到 Include 文件夹内，仅此而已，所以我就偷懒没有做安装程序了。   
**使用说明**   
目前只模拟了极少数 Borland C++ 3.1 的绘图库，只是把我个人理解中的初学者常用的图形函数模拟了一下。   
使用上，基本和 TC 没什么区别。看一个画圆的例子吧： 

```
#include <graphics.h> // 就是需要引用这个图形库 
#include <conio.h> 
void main() 
{ 
initgraph(640, 480); // 这里和 TC 略有区别 
circle(200, 200, 100); // 画圆，圆心(200, 200)，半径 100 
getch();              // 按任意键继续 
closegraph();    // 关闭图形界面 
} 
```

 呵呵，很简单吧。