1 get the mtd-utils source code form the net through git clone or another way.
2 if has same problem about uuid ,then do:
切换到12.04下之后通过apt-get install uuid-dev安装uuid之后,之前的代码中的uuid_generate,uuid_unparse函数在新的库中不存在了(和10.04中的uuid-dev不是同一个包),导致链接失败。
为了不改动原有自己已写好的程序,只有找原先的uuid lib。解决方案如下:
在https://answers.launchpad.net/ubuntu/+source/util-linux/2.20.1-1ubuntu1中下载到util-linux_2.20.1.orig.tar.gz包,里面包含很多系统工具的目录,如包含libuuid目录。使用下面的方法安装uuid库(包括静态lib文件及动态链接文件):
tar xzvf util-linux_2.20.1.orig.tar.gz
cd util-linux-2.20.1
./configure --without-ncurses
cd libuuid
make
make install
3 when I update the mtd-utils code,I can't find the Makefile rules file.So I must to do something to born the Makefile.
1. 执行aclocal
,产生aclocal.m4
文件
2. 执行autoconf
,生成configure
文件
3. 执行automake
命令,产生Makefile.in
4. 执行configure
命令,生成Makefile
文件
这样,就产生了编译所需要的
Makefile
文件。运行
make
,即可编译
这里在进行第四步的时候很可能会遇到一个问题:
- 1
- 2
出现该情况是由于c++编译器的相关package没有安装。
以Ubuntu为例,解决如下: