我正在做一个与鼠标编程相关的项目。我遇到了一个问题,即graphics.h
,conio.h
并且dos.h
无法在 gcc 中工作。我试过了http://blog.eternal-thinker.com/2010/09/how-to-use-graphicsh-in-ubuntu.html。
当我进入
sudo apt-get install build-essential
我有:
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
build-essential set to manually installed.
The following packages were automatically installed and are no longer required:
calligra-l10n-engb cdparanoia k3b k3b-data k3b-i18n kdevelop-l10n
kdevelop-php-docs-l10n kdevelop-php-l10n language-pack-kde-en libflac++6
libk3b6 libkcddb4
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
然后我尝试
sudo apt-get install libsdl-image1.2 libsdl-image1.2-dev guile-1.8 guile-1.8-dev libsdl1.2debian-all libart-2.0-dev libaudiofile-dev libesd0-dev libdirectfb-dev libdirectfb-extra libfreetype6-dev libxext-dev x11proto-xext-dev libfreetype6 libaa1 libaa1-dev libslang2-dev libasound2 libasound2-dev
我收到以下错误:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libsdl1.2debian-all is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source
However the following packages replace it:
libsdl1.2debian
E: Package 'libsdl1.2debian-all' has no installation candidate
请帮助我在 gcc 中使用graphics.h
和。conio.h
dos.h
答案1
据我所知,graphics.h 是 Ms DOS 操作系统中用于图形的旧版 Borland C++ 头文件。我认为最新的 Borland C++Builder 不再支持 graphics.h。但是 graphics.h 已针对 Windows 进行了模拟。使用 graphics.h 制作的可执行文件通常无法在较新的 PC(以及使用 Windows 操作系统的笔记本电脑)上运行。
(尽管 graphics.h 具有简单易用的图形功能,但不再推荐/支持使用它)
开源 C++ 编译器通常也不支持 conio.h。
conio.h 具有 Borland 编译器中的大多数功能。它也受 MS VC++ 支持,但功能较少。conio.h 不受 gcc 等支持。