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>
  • 相关阅读:
    为什么linux有足够的内存还进行swap?
    vmstat命令的使用
    Windows远程服务器不能复制粘贴
    Windows可以ping通百度,但是用浏览器打不开网页
    java形式参数分别是基本类型和引用类型的调用
    Ubuntu16.04安装Python3.6 和pip
    Python2/3共存,pip2/3共存
    multiprocessing模块
    Python-进程与线程
    鼠标不能动,插上了但没反应
  • 原文地址:https://www.cnblogs.com/googlegis/p/2978730.html
Copyright © 2011-2022 走看看