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

[BUG] undeclared identifier 'pthread_condattr_setclock' #2612

Closed
yoobi opened this issue Jan 14, 2023 · 4 comments
Closed

[BUG] undeclared identifier 'pthread_condattr_setclock' #2612

yoobi opened this issue Jan 14, 2023 · 4 comments
Labels
[build] Area: Changes in build files Type: Bug Indicates an unexpected problem or unintended behavior
Milestone

Comments

@yoobi
Copy link

yoobi commented Jan 14, 2023

Describe the bug
I'm using srtdroid which in turn use your library. I've tried running it using Android API 19 but it crash with the following stacktrace:

  srtcore/sync_posix.cpp:306:5: error: use of undeclared identifier 'pthread_condattr_setclock'; did you mean 'pthread_condattr_setpshared'?
      pthread_condattr_setclock(&CondAttribs, CLOCK_MONOTONIC);
      ^~~~~~~~~~~~~~~~~~~~~~~~~
      pthread_condattr_setpshared
  /usr/local/lib/android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/pthread.h:137:5: note: 'pthread_condattr_setpshared' declared here
  int pthread_condattr_setpshared(pthread_condattr_t* __attr, int __shared);
      ^

To Reproduce
ThibaultBee/srtdroid#30 see the https://github.com/ThibaultBee/srtdroid/actions/runs/3918612479/jobs/6699102675

Expected behavior
Not to crash

Desktop (please provide the following information):

  • OS: Android API 19
  • SRT Version / commit ID: version 1.5.1
@yoobi yoobi added the Type: Bug Indicates an unexpected problem or unintended behavior label Jan 14, 2023
@ethouris
Copy link
Collaborator

Might be that this version of SDK doesn't support this feature. Not sure how it can be autodetected. You can try with adding -DENABLE_STDCXX_SYNC=ON for cmake.

@yoobi
Copy link
Author

yoobi commented Jan 17, 2023

Thanks for your help. I'm using srtdroid which in turns use your lib, the CMAKE is the following: https://github.com/ThibaultBee/srtdroid/blob/feat/android-19-support/lib/src/main/cpp/CMakeLists.txt#L29

I'll try adding the line you mentioned and also should I change something else ?

@ethouris
Copy link
Collaborator

For managing the threads and time we are using a wrapper library that is implemented with the use of either POSIX primitives or the C++11 standard library. The POSIX version is default because some older compilers don't support C++11.

There's not much else I could tell you because the Android version is only unofficially supported by the community. You might find some interesting things in the android-specific documentation for SRT (in the docs directory).

@yoobi
Copy link
Author

yoobi commented Jan 31, 2023

Thank you adding -DENABLE_STDCXX_SYNC=ON solved my issue

@yoobi yoobi closed this as completed Jan 31, 2023
@maxsharabayko maxsharabayko added the [build] Area: Changes in build files label Jan 31, 2023
@maxsharabayko maxsharabayko added this to the v1.5.2 milestone Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[build] Area: Changes in build files Type: Bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants