zoukankan      html  css  js  c++  java
  • undefined reference to `pthread_mutexattr_destroy'

    host C++: libgtest_host <= external/gtest/src/gtest-all.cc
    true
    host C++: libgtest_main_host <= external/gtest/src/gtest_main.cc
    out/host/linux-x86/obj/STATIC_LIBRARIES/libLLVMSupport_intermediates/libLLVMSupport.a(Signals.o): In function `PrintStackTrace':
    /home/aa/project/android4.0.1/external/llvm/lib/Support/Unix/Signals.inc:219: undefined reference to `dladdr'
    /home/aa/project/android4.0.1/external/llvm/lib/Support/Unix/Signals.inc:231: undefined reference to `dladdr'
    out/host/linux-x86/obj/STATIC_LIBRARIES/libLLVMSupport_intermediates/libLLVMSupport.a(Threading.o): In function `llvm::llvm_execute_on_thread(void (*)(void*), void*, unsigned int)':
    /home/aa/project/android4.0.1/external/llvm/lib/Support/Threading.cpp:96: undefined reference to `pthread_create'
    /home/aa/project/android4.0.1/external/llvm/lib/Support/Threading.cpp:91: undefined reference to `pthread_attr_setstacksize'
    /home/aa/project/android4.0.1/external/llvm/lib/Support/Threading.cpp:100: undefined reference to `pthread_join'
    out/host/linux-x86/obj/STATIC_LIBRARIES/libLLVMSupport_intermediates/libLLVMSupport.a(Mutex.o): In function `MutexImpl':
    /home/aa/project/android4.0.1/external/llvm/lib/Support/Mutex.cpp:69: undefined reference to `pthread_mutexattr_init'
    /home/aa/project/android4.0.1/external/llvm/lib/Support/Mutex.cpp:75: undefined reference to `pthread_mutexattr_settype'
    /home/aa/project/android4.0.1/external/llvm/lib/Support/Mutex.cpp:80: undefined reference to `pthread_mutexattr_setpshared'
    /home/aa/project/android4.0.1/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/aa/project/android4.0.1/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
    make: *** Waiting for unfinished jobs....
    解决方法:
    $vi external/llvm/llvm-host-build.mk
    LOCAL_LDLIBS := -lpthread -ldl
    下面这个解决方法没成功,会有新的错误:errors again :can't find threads.h file or dir.
    $ vi external/llvm/lib/Support/Android.mk
    LOCAL_C_INCLUDES += system/core/include/cutils
    LOCAL_SHARED_LIBRARIES := libcutil
    $ vi external/llvm/lib/Support/Mutex.cpp
    #include <threads.h>
    $ vi external/llvm/lib/Support/Threading.cpp
    #include <threads.h>
  • 相关阅读:
    四天玩转 Windows Phone 开发教学视频
    DZNT REST API doc
    【译著】Code First :使用Entity. Framework编程(1)
    如何关闭ReSharper中的[ Use 'var' ]提示How to Disable C# “var” Recommendation in ReSharper
    查看域名txt记录
    VS文本编辑器vssettings下载站
    .net 开发windows服务
    .net 简单图表控件 (之总结篇 源代码及测试示例) [c/s桌面应用程序控件] IV
    c# 算节气
    js 自定义title提示框
  • 原文地址:https://www.cnblogs.com/googlegis/p/2978730.html
Copyright © 2011-2022 走看看