Does Android support stream?

Does Android support pthreads? And why, when I use the -pthread option, I see a linker error:

i686-android-linux / bin / ld: cannot find -lpthread

#include <pthread.h> #include <cxxabi.h> extern "C" int printf (const char *, ...); int main() { try { pthread_exit (0); } catch (abi::__forced_unwind &) { printf ("caught forced unwind\n"); throw; } catch (...) { printf ("caught ...\n"); return 1; } } 
+4
source share
1 answer

As far as I could see in the docs, you do not need to use "-pthread". Checkout:
http://mobilepearls.com/labs/native-android-api/#pthreads

Information from the status of offline NDK documents (android-ndk-r8 \ docs \ system \ libc \ OVERVIEW.html):

  PThread implementation: 
Bionic C library comes with its own pthread implementation bundled in. This is different from other historical C libraries which: - place it in an external library (-lpthread) - play linker tricks with weak symbols at dynamic link time

So keep in mind that Bionic includes directly pthread, not the standard way you're used to (with -lpthread).

+7
source

All Articles