3

I'm trying to compile a shared library using cmake. I followed the instruction on this tutorial to change the toolchain for android NDK. However, I'm getting the following output error:

/home/usr/android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lpthread
collect2: error: ld returned 1 exit status
make[2]: *** [../libs/armeabi-v7a/libutils.so] Error 1
make[1]: *** [src/CMakeFiles/utils.dir/all] Error 2
make: *** [all] Error 2

A bit of googling around and I stumble upon this stackoverflow post. So I modified my CMakeLists.txt to add:

set(CMAKE_CXX_FLAGS"-DHAVE_PTHREADS")

but it seems like it still doesn't work. Am I going about this the wrong way?

Thanks!

Community
  • 1
  • 1
vaat
  • 31
  • 4

0 Answers0