googlearchive / tango-examples-c

JNI example projects for Project Tango [deprecated] C-API
https://developers.google.com/ar
Apache License 2.0
337 stars 204 forks source link

Mutex compiliation error #70

Open yassiezar opened 8 years ago

yassiezar commented 8 years ago

HI,

I'm having trouble compiling some of the examples that use the Mutex library. At compile time, it throws me this error:

~/Android/ndk-examples/tango-examples-c/cpp_motion_tracking_example/app/src/main/jni/tango-motion-tracking/motion_tracking_app.h
Error:(96, 8) error: 'mutex' in namespace 'std' does not name a type

Referring to this line in motion_tracking_app.h:

std::mutex pose_mutex_;

Has anyone else ran into this problem? I'm still getting started with Tango and the NDK so I'm having trouble debugging this error.

yassiezar commented 8 years ago

I managed to fix it. Changing the APP_STL line in the Application.mk file to use c++_static instead of gnustl_static seems to have fixed it

andersgb commented 7 years ago

Do you compile with C++11 support? gnustl_static should happily work with std::mutex if you set LOCAL_CPPFLAGS := -std=c++11 in your Android.mk