ubuntu12.04.4(x64)编译android-4.0.1_r1代码错误解决
2014-04-29 13:08
281 查看
1、/usr/bin/ld.bfd.real: cannot find -lGL
查看了一些资料,因为编译的时候还是用到了32BIT的libGL.so libX11.so库文件,编译的时候找的不是X86_64库文件配置,而是找的是I386库文件配置
$ sudo apt-get installibgl1-mesa-glx:i386(libGL.so)
由于libGL.so系统默认没有进行库路径下的链接,还需要手动链接一下
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
2、external/llvm/lib/Support/Mutex.cpp:143: undefined reference to `pthread_mutex_trylock'
collect2: ld returned 1 exit status
解决办法:
vim external/llvm/llvm-host-build.mk
LOCAL_LDLIBS := -lpthread -ldl
3、gtest错误
external/gtest/src/../include/gtest/internal/gtest-param-util.h:122:11: error: ‘ptrdiff_t’ does not name a type
解决:
external/gtest里打patch或者自己手动修改
diff --git a/include/gtest/internal/gtest-param-util.h b/include/gtest/internal/gtest-param-util.h
index 5559ab4..b964c45 100644
--- a/include/gtest/internal/gtest-param-util.h
+++ b/include/gtest/internal/gtest-param-util.h
@@ -37,6 +37,7 @@
#include <iterator>
#include <utility>
#include <vector>
+#include <cstddef>
#include <gtest/internal/gtest-port.h>
4、mutable错误
external/oprofile/libpp/format_output.h:94:22: error: reference ‘counts’ cannot be declared ‘mutable’ [-fpermissive]
解决方法:
external/oprofile里打patch或者自己手动修改文件
diff --git a/libpp/format_output.h b/libpp/format_output.h
index b6c4592..4efdbb1 100644
--- a/libpp/format_output.h
+++ b/libpp/format_output.h
@@ -91,7 +91,8 @@ protected:
symbol_entry const & symbol;
sample_entry const & sample;
size_t pclass;
- mutable counts_t & counts;
+// mutable counts_t & counts;
+ counts_t & counts;
extra_images const & extra;
double diff;
};
5、<命令行>:0:0: 错误: “_FORTIFY_SOURCE”重定义 [-Werror]
6、error: variable ‘ParamName’ set but not used [-Werror=unused-but-set-variable]
遇到这个错误
host C++: llvm-rs-cc <= frameworks/compile/slang/slang_rs_export_foreach.cpp
frameworks/compile/slang/slang_rs_export_foreach.cpp: In static member function ‘static slang::RSExportForEach* slang::RSExportForEach::Create(slang::RSContext*, const clang::FunctionDecl*)’:
frameworks/compile/slang/slang_rs_export_foreach.cpp:247:23: error: variable ‘ParamName’ set but not used [-Werror=unused-but-set-variable]
cc1plus: all warnings being treated as errors
解决办法有两个
1.注释掉frameworks/compile/slang/slang_rs_export_foreach.cpp 中的247行的 定义ParamName的语句;
2..在工程根目录下,打开下面的makefile文件:
# vi frameworks/compile/slang/Android.mk
在打开的makefile文件中按照下面更改:
-----local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter -Werror
++++local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter
http://blog.csdn.net/yuan1590/article/details/7530735 http://blog.csdn.net/shuzui1985/article/details/7628121 http://hcleon.iteye.com/blog/1461352 http://blog.csdn.net/zlm_250/article/details/7949440 http://blog.csdn.net/conanyang/article/details/751874
查看了一些资料,因为编译的时候还是用到了32BIT的libGL.so libX11.so库文件,编译的时候找的不是X86_64库文件配置,而是找的是I386库文件配置
$ sudo apt-get installibgl1-mesa-glx:i386(libGL.so)
由于libGL.so系统默认没有进行库路径下的链接,还需要手动链接一下
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
2、external/llvm/lib/Support/Mutex.cpp:143: undefined reference to `pthread_mutex_trylock'
collect2: ld returned 1 exit status
解决办法:
vim external/llvm/llvm-host-build.mk
LOCAL_LDLIBS := -lpthread -ldl
3、gtest错误
external/gtest/src/../include/gtest/internal/gtest-param-util.h:122:11: error: ‘ptrdiff_t’ does not name a type
解决:
external/gtest里打patch或者自己手动修改
diff --git a/include/gtest/internal/gtest-param-util.h b/include/gtest/internal/gtest-param-util.h
index 5559ab4..b964c45 100644
--- a/include/gtest/internal/gtest-param-util.h
+++ b/include/gtest/internal/gtest-param-util.h
@@ -37,6 +37,7 @@
#include <iterator>
#include <utility>
#include <vector>
+#include <cstddef>
#include <gtest/internal/gtest-port.h>
4、mutable错误
external/oprofile/libpp/format_output.h:94:22: error: reference ‘counts’ cannot be declared ‘mutable’ [-fpermissive]
解决方法:
external/oprofile里打patch或者自己手动修改文件
diff --git a/libpp/format_output.h b/libpp/format_output.h
index b6c4592..4efdbb1 100644
--- a/libpp/format_output.h
+++ b/libpp/format_output.h
@@ -91,7 +91,8 @@ protected:
symbol_entry const & symbol;
sample_entry const & sample;
size_t pclass;
- mutable counts_t & counts;
+// mutable counts_t & counts;
+ counts_t & counts;
extra_images const & extra;
double diff;
};
5、<命令行>:0:0: 错误: “_FORTIFY_SOURCE”重定义 [-Werror]
修改build/core/combo/HOST_linux-x86.mk 61行,将 HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0 修改成 HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 Android源码换服务器了,具体的看http://source.android.com/source/downloading.html
6、error: variable ‘ParamName’ set but not used [-Werror=unused-but-set-variable]
遇到这个错误
host C++: llvm-rs-cc <= frameworks/compile/slang/slang_rs_export_foreach.cpp
frameworks/compile/slang/slang_rs_export_foreach.cpp: In static member function ‘static slang::RSExportForEach* slang::RSExportForEach::Create(slang::RSContext*, const clang::FunctionDecl*)’:
frameworks/compile/slang/slang_rs_export_foreach.cpp:247:23: error: variable ‘ParamName’ set but not used [-Werror=unused-but-set-variable]
cc1plus: all warnings being treated as errors
解决办法有两个
1.注释掉frameworks/compile/slang/slang_rs_export_foreach.cpp 中的247行的 定义ParamName的语句;
2..在工程根目录下,打开下面的makefile文件:
# vi frameworks/compile/slang/Android.mk
在打开的makefile文件中按照下面更改:
-----local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter -Werror
++++local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter
http://blog.csdn.net/yuan1590/article/details/7530735 http://blog.csdn.net/shuzui1985/article/details/7628121 http://hcleon.iteye.com/blog/1461352 http://blog.csdn.net/zlm_250/article/details/7949440 http://blog.csdn.net/conanyang/article/details/751874
相关文章推荐
- [Android学习系列15]下拉刷新列表实现动态加载
- Android 获取apk签名的fingerprint
- Android 加载gif动画
- Android Popupwindow 拖动
- android操作XML的几种方式
- Android 事件
- Android JUnit Test Unable to execute dex: Multiple dex files define 解决方法
- 一篇文章让你读懂iOS和Android的历史起源
- Android Studio 安装时出现 No JVM installation found 怎么办
- Android获取长按按键响应
- android 中处理崩溃异常并重启程序
- 【Android学习笔记】RadioGroup,RadioButton的使用&CheckBox的使用
- Android 48个小知识
- Android ROM包制作
- 第十五天 乐在其中-Android与远端之POST方式
- Android应用之《宋词三百首》(一)
- android :点击某个按钮弹出在原有布局中没有(或者存在)内容 :以删除原有布局内容为例
- Android动画效果translate、scale、alpha、rotate详解
- Android Camera子系统之用户View
- android memory leak analysis tools