Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jonahzheng opened this issue Jul 26, 2017 · 4 comments
Open

Comments

@jonahzheng
Copy link

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
Copy link

same issue

@reamal
Copy link

reamal commented Sep 1, 2017

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
Copy link
Author

@Lilee902 thank you

@ChenQingZhen
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants