anyrtcIO-Community / anyRTC-RTMP-OpenSource

RTMP 推流器,RTMP(HLS)秒开播放器,直播点播,跨平台(Win,IOS,Android)开源代码
https://www.anyrtc.io
GNU General Public License v3.0
4.65k stars 1.6k forks source link

error: 'pthread_condattr_setclock' was not declared in this scope #84

Open jonahzheng opened 6 years ago

jonahzheng commented 6 years ago

Build command failed. Error while executing process D:\PlatformSDKs\android-sdk-windows\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=D:\AS_Project\anyRTC-RTMP-OpenSource-master\Prj-Android\jni\toolchain\Android.mk APP_ABI=armeabi NDK_ALL_ABIS=armeabi NDK_DEBUG=1 APP_PLATFORM=android-16 NDK_OUT=D:/AS_Project/anyRTC-RTMP-OpenSource-master/Prj-Android/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=D:\AS_Project\anyRTC-RTMP-OpenSource-master\Prj-Android\app\build\intermediates\ndkBuild\debug\lib NDK_APPLICATION_MK:=../jni/Application.mk D:/AS_Project/anyRTC-RTMP-OpenSource-master/Prj-Android/app/build/intermediates/ndkBuild/debug/obj/local/armeabi/libanyrtmp-jni.so} Android NDK: WARNING:D:/AS_Project/anyRTC-RTMP-OpenSource-master/Prj-Android/jni/toolchain/../Android.mk:anyrtmp-jni: non-system libraries in linker flags: -lavformat -lavcodec -lavutil
Android NDK: This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES
Android NDK: or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the
Android NDK: current module
Android NDK: WARNING: Unsupported source file extensions in D:/AS_Project/anyRTC-RTMP-OpenSource-master/Prj-Android/jni/toolchain/../../../webrtc/Android.mk for module webrtc
Android NDK: system_wrappers/source/trace_impl.h
[armeabi] Compile++ thumb: webrtc <= event_timer_posix.cc D:/AS_Project/anyRTC-RTMP-OpenSource-master/Prj-Android/jni/toolchain/../../../webrtc/system_wrappers/source/event_timer_posix.cc: In constructor 'webrtc::EventTimerPosix::EventTimerPosix()': D:/AS_Project/anyRTC-RTMP-OpenSource-master/Prj-Android/jni/toolchain/../../../webrtc/system_wrappers/source/event_timer_posix.cc:53:56: error: 'pthread_condattr_setclock' was not declared in this scope pthread_condattr_setclock(&cond_attr, CLOCK_MONOTONIC);

guobosheng commented 6 years ago

same issue

reamal commented 6 years ago

same issue
Android studio 3.0 canary 8

i saw this code in pthread.h

if __ANDROID_API__ >= 21

int pthread_condattr_setclock(pthread_condattr_t* _Nonnull, clockid_t) __INTRODUCED_IN(21);

endif / __ANDROID_API__ >= 21 /

so modify the minsdk to 21 in gradle

defaultConfig { ... minSdkVersion 21 targetSdkVersion 23 .. }

then build success

jonahzheng commented 6 years ago

@Lilee902 thank you

ChenQingZhen commented 5 years ago

@Lilee902 你的方法可以运行,不知道大家有没有找到可以兼容低版本的方法?