在Linux上安装图形库
我不是 Linux 专家,我正在尝试在 Ubuntu 10.10 上安装 2D 图形库。我需要制作 2D 显示,经过一些在线研究后,GooCanvas 似乎符合要求。
我很沮丧,因为它根本无法安装,而且我没有得到我应该做的事情。
这就是我所做的。
1> git clone git://git.gnome.org/goocanvas #built a goocanvas directory
2> cd goocanvas
3> ls
AUTHORS ChangeLog demo goocanvas.doap NEWS src
autogen.sh configure.in docs MAINTAINERS po TODO
autom4te.cache COPYING goocanvas-2.0.pc.in Makefile.am README
4> less README #here's what it says
To build it run './configure' and 'make'. To run the demo cd into 'demo' and
run './demo'. (Or run ./simple-demo for the very simple demo, or ./mv-demo
for the model-view demo.)
5> ./configure # error: bash: ./configure: No such file or directory
6> find . -name "configure*" -print #there aren't any other configure scripts?
'制作;和“make install”也不起作用。
好吧,我很沮丧。如果没有的话为什么会说运行配置?我该如何安装这个东西?
有谁知道一个易于使用的 ubuntu 图形库,可以实际工作。并且可以轻松安装?
I'm not a linux expert, and I'm trying to install a 2D graphics library on Ubuntu 10.10. I need to make a 2D display and after a little online research, GooCanvas seems like it will fit the bill.
I'm frustrated because it simply won't install and I don't get what I am supposed to do.
Here's what I did.
1> git clone git://git.gnome.org/goocanvas #built a goocanvas directory
2> cd goocanvas
3> ls
AUTHORS ChangeLog demo goocanvas.doap NEWS src
autogen.sh configure.in docs MAINTAINERS po TODO
autom4te.cache COPYING goocanvas-2.0.pc.in Makefile.am README
4> less README #here's what it says
To build it run './configure' and 'make'. To run the demo cd into 'demo' and
run './demo'. (Or run ./simple-demo for the very simple demo, or ./mv-demo
for the model-view demo.)
5> ./configure # error: bash: ./configure: No such file or directory
6> find . -name "configure*" -print #there aren't any other configure scripts?
'make; and 'make install' don't work either.
OK, I'm frustrated. Why does it say run configure if there isn't one? How do I install this thing?
Does anyone know an easy to use graphics library for ubuntu that will actually work. and can be easily installed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
看看这个:我们开发了一个 2d 图形库和窗口系统(GWS):https://github.com/ MnMInfoTech/GWS
Check this out: We have developed a 2d Graphics library and Windowing System(GWS): https://github.com/MnMInfoTech/GWS
Cairo,在谈论 GTK 时通常被认为是一个很好的 2D 库。安装应该很容易,因为这将在您的发行版存储库中(从命令行以 root 身份运行 apt-get install libcairo2-dev )。
现在我想起来了 - 你对 Linux 还很陌生,不会先查看你的软件存储库 - 学会这样做! 我检查了并发现 Ubuntu 宇宙已经存在有 goocanvas,只需 apt-get install libgoocanvas-dev 就可以了。
Cairo, which is usually assumed when talking about GTK, is a good 2D library. Installing should be easy as this will be in your distributions repository (from the command line as root run
apt-get install libcairo2-dev
).Now that I think about it - your new enough to Linux not to look at your repository for software first - learn to do that! I checked and found Ubuntu universe already has goocanvas, just
apt-get install libgoocanvas-dev
and you should be good to go.大的有什么问题:
What is wrong with the big ones:
他们的说明已过时,请先执行
autogen.sh
文件。您需要 gtk-doc-tools 和其他一些软件包来支持编译。编辑1:
看起来它需要 GTK 3.0、glib 2.28+ 和 Cairo 1.1+ - 这些都是相当现代的。我不确定 Ubuntu 10.10 有它们(我使用的是 10.04),启动
Synaptic Package Manager
并搜索libgtk
头文件位于开发包中。编辑2:
您正在寻找哪种图形包? SDL 可能行得通,或者开罗。
Their instructions are out of date, execute the
autogen.sh
file first. You'll need thegtk-doc-tools
and some other packages to support compiling things.Edit 1:
Looks like it needs GTK 3.0, glib 2.28+, and Cairo 1.1+ - those are pretty modern. I'm not sure what Ubuntu 10.10 has them (I'm on 10.04), launch
Synaptic Package Manager
and search forlibgtk
the header files are in dev packages.Edit 2:
What sort of graphics package are you looking for? SDL may work, or Cairo.
使用SDL
如果你想在Ubuntu平台上使用graphics.h,你需要编译并安装libgraph。它是turbo c图形API在Linux上使用SDL的实现。
它不是很强大,适合生产质量应用,但它简单易用,适合学习目的。
您可以从 http://download.savannah 下载它。 gnu.org/releases/libgraph/libgraph-1.0.2.tar.gz。
首先通过输入
sudo apt-get install build-essential 安装 build-essential
安装一些附加软件包
通过输入sudo apt-get install libsdl-image1.2 libsdl-image1.2-dev guile-1.8 \
guile-1.8-dev libsdl1.2debian 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
现在解压下载的 libgraph-1.0 .2.tar.gz 文件。
转到提取的文件夹并运行以下命令
./configure
make
sudo make install
sudo cp /usr/local/lib/libgraph.* /usr/lib
现在您可以在 ubuntu 平台上使用 #include
使用 gcc demo.c -o demo - 进行编译lglut -lGL
使用 ./demo 运行它
Using SDL
If you want to use graphics.h on Ubuntu platform you need to compile and install libgraph. It is the implementation of turbo c graphics API on Linux using SDL.
It is not very powerful and suitable for production quality application, but it is simple and easy-to-use for learning purpose.
You can download it from http://download.savannah.gnu.org/releases/libgraph/libgraph-1.0.2.tar.gz.
First install build-essential by typing
sudo apt-get install build-essential
Intall some additional packages by typing
sudo apt-get install libsdl-image1.2 libsdl-image1.2-dev guile-1.8 \
guile-1.8-dev libsdl1.2debian 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
Now extract the downloaded libgraph-1.0.2.tar.gz file.
Goto extracted folder and run following command
./configure
make
sudo make install
sudo cp /usr/local/lib/libgraph.* /usr/lib
Now you can use #include on ubuntu platform
Compile it using gcc demo.c -o demo -lglut -lGL
Run it using ./demo