我想用这个文档来构建android的源代码:https://source.android.com/source/building-running.html
最后一步是:'make -j16'
一段时间后,编译终止,并显示以下错误消息:
host C++: libart <= art/runtime/catch_block_stack_visitor.cc
host C++: libart <= art/runtime/catch_finder.cc
art/compiler/elf_stripper.cc:122:16: error: use of undeclared identifier 'ftruncate'
int result = ftruncate(file->Fd(), offset);
^
1 error generated.
make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libart-compiler_intermediates/elf_stripper.o] Fehler 1
make: *** Warte auf noch nicht beendete Prozesse...
我不知道。谷歌没有帮助,我真的不进入这个话题,只是想做一点改变android代码(我还没有改变任何东西)。
我的系统是:
ubuntu 13.10
java 1.6.0_4
current android master branch
您可以通过添加
来避免这个问题#include <unistd.h>
elf_stripe .cc