Android开发-编译ICS时遇到collect2: ld returned 1 exit status错误解决方案
2011-12-19 17:15
686 查看
编译Android4.0时遇到下面的问题,
/home/joeyjiaojg/android/src/cm4/external/llvm/lib/Support/Mutex.cpp:69: undefined reference to `pthread_mutexattr_init'
/home/joeyjiaojg/android/src/cm4/external/llvm/lib/Support/Mutex.cpp:75: undefined reference to `pthread_mutexattr_settype'
/home/joeyjiaojg/android/src/cm4/external/llvm/lib/Support/Mutex.cpp:80: undefined reference to `pthread_mutexattr_setpshared'
/home/joeyjiaojg/android/src/cm4/external/llvm/lib/Support/Mutex.cpp:89: undefined reference to `pthread_mutexattr_destroy'
out/host/linux-x86/obj/STATIC_LIBRARIES/libLLVMSupport_intermediates/libLLVMSupport.a(Mutex.o): In function `llvm::sys::MutexImpl::tryacquire()':
/home/joeyjiaojg/android/src/cm4/external/llvm/lib/Support/Mutex.cpp:143: undefined reference to `pthread_mutex_trylock'
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/test-librsloader_intermediates/test-librsloader] Error 1
解决方法:
进入源码的根目录
使用命令:gedit external/llvm/lib/Support/Android.mk
在文件中的两部分都加入LOCAL_C_INCLUDES+=system/core/include/cutils和LOCAL_SHARED_LIBRARIES := libcutil
使用命令:gedit external/llvm/lib/Support/Mutex.cpp
在Mutex.cpp中加入头文件 “#include <threads.h>”
使用命令:gedit external/llvm/lib/Support/Threading.cpp
在Threading.cpp中加入头文件 “#include <threads.h>”
/home/joeyjiaojg/android/src/cm4/external/llvm/lib/Support/Mutex.cpp:69: undefined reference to `pthread_mutexattr_init'
/home/joeyjiaojg/android/src/cm4/external/llvm/lib/Support/Mutex.cpp:75: undefined reference to `pthread_mutexattr_settype'
/home/joeyjiaojg/android/src/cm4/external/llvm/lib/Support/Mutex.cpp:80: undefined reference to `pthread_mutexattr_setpshared'
/home/joeyjiaojg/android/src/cm4/external/llvm/lib/Support/Mutex.cpp:89: undefined reference to `pthread_mutexattr_destroy'
out/host/linux-x86/obj/STATIC_LIBRARIES/libLLVMSupport_intermediates/libLLVMSupport.a(Mutex.o): In function `llvm::sys::MutexImpl::tryacquire()':
/home/joeyjiaojg/android/src/cm4/external/llvm/lib/Support/Mutex.cpp:143: undefined reference to `pthread_mutex_trylock'
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/test-librsloader_intermediates/test-librsloader] Error 1
解决方法:
进入源码的根目录
使用命令:gedit external/llvm/lib/Support/Android.mk
在文件中的两部分都加入LOCAL_C_INCLUDES+=system/core/include/cutils和LOCAL_SHARED_LIBRARIES := libcutil
使用命令:gedit external/llvm/lib/Support/Mutex.cpp
在Mutex.cpp中加入头文件 “#include <threads.h>”
使用命令:gedit external/llvm/lib/Support/Threading.cpp
在Threading.cpp中加入头文件 “#include <threads.h>”
相关文章推荐
- redis编译安装:make 的新错误--collect2: ld returned 1 exit status
- centos7.1 QT5编译出现:cannot find -lGL 和 collect2:error:ld returned 1 exit status 错误
- Ubuntu15.04 QT5编译出现cannot find -lGL 和 collect2:error:ld returned 1 exit status 错误
- centos7.1 QT5编译出现:cannot find -lGL 和 collect2:error:ld returned 1 exit status 错误
- ubantu下QT开发不能编译报collect2: ld returned 1 exit status的解决
- Android 编译错误:collect2: ld returned 1 exit status
- 关于Qt交叉编译过程中出现的collect2: ld returned 1 exit status问题的解决方案
- Android开发错误——Android Studio中遇到过的错误问题与解决方案汇总
- Android编译遇到错误/usr/bin/ld: cannot find -lstdc++的解决
- 【linux c 编译】collect2: ld returned 1 exit status
- xp系统Arduino编译时,出现collect2.exe: error: ld returned 5 exit status的解决方案
- 交叉编译:cannot find /lib/libc.so.6 collect2: ld returned 1 exit status
- 自定义库引用时编译出错“collect2: error: ld returned 1 exit status”
- QT编译错误:collect2: ld returned 1 exit status
- Android 开发环境搭建 与在编译中遇到错误make Error 45解决方法
- 【原创】“collect2: ld returned 1 exit status”错误
- Android编译遇到错误/usr/bin/ld: cannot find -lstdc++的解决
- 在运行qt程序时遇到的collect2:ld returned 1 exit status
- GCC 中 undefined reference to ‘ceil’ collect2:ld returned 1 exit status 错误
- QT4 编译错误 error: collect2: ld returned 1 exit status