代码改变世界

在Ubuntu下源码安装Bochs出错记录

2013-05-02 15:45 by fingertouch, 236 阅读, 0 推荐, 收藏, 编辑
摘要:本文安装的Bochs版本为2.6.1Ubuntu版本为:12.04问题一(./configure):error "/lib/cpp"fails sanity check原因:没有安装C++的编译环境解决方案:sudo apt-get install build-essential问题二(make):error:pkg-config was notfound, or unable to access the gtk+-2.0 package.原因:缺少gtk包解决方案:sudo apt-get install libgtk2.0-dev安装完成之后,默认的安装路径是/usr/ 阅读全文

如何在Linux下写汇编

2013-05-02 15:23 by fingertouch, 5449 阅读, 0 推荐, 收藏, 编辑
摘要:本文为翻译文章,原文参见:http://docs.cs.up.ac.za/programming/asm/derick_tut/ 1.NASM编译器 目前Linux下的汇编器主要有:as、as86和gas,但是本文使用的是NASM(The Netwide Assembler)。它使用Intel形式的汇编格式,和Intel形式相对的是AT&T形式的汇编格式。 2.Linux下汇编介绍 2.1... 阅读全文

Linux下编译程序

2012-10-29 23:38 by fingertouch, 237 阅读, 0 推荐, 收藏, 编辑
摘要:一.编译C程序1.编译单个C程序:现编译如下程序(hello.c):#include<stdio.h>#include<stdlib.h>int main(int argc,char *argv[]){ printf("Hello Linux!"); return 0;} 使用:#gcc -o hello hello.c其中:-o选项是用来重命名程序名词,否则默认的程序名词为a.out2.编译多个源文件现同时编译两个文件(hello.h hello.c和main.c)://hello.h#ifndef __HELLO_H_#define __HELL 阅读全文