openframeworks / openframeworks/openFrameworks
Android studio not finding std c++ headers using ofxPoco
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.4k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 9
Description
I am working with the current master as of today and when I try to add ofxPoco to a project I get a lot of errors, mostly related to this:
error: no type named 'string' in namespace 'std'
Exception(const std::string& msg, int code = 0);
The compile stops as there are too many errors, but here is some more verbose output:
/Users/fredrodrigues/Library/Android/sdk/ndk/android-ndk-r15c/sources/cxx-stl/llvm-libc++/include/stdexcept:74:32: error: unknown type name 'string'
explicit logic_error(const string&);
^
/Users/fredrodrigues/Library/Android/sdk/ndk/android-ndk-r15c/sources/cxx-stl/llvm-libc++/include/stdexcept:91:34: error: unknown type name 'string'
explicit runtime_error(const string&);
^
/Users/fredrodrigues/Library/Android/sdk/ndk/android-ndk-r15c/sources/cxx-stl/llvm-libc++/include/stdexcept:106:59: error: unknown type name 'string'
_LIBCPP_INLINE_VISIBILITY explicit domain_error(const string& __s) : logic_error(__s) {}
^
/Users/fredrodrigues/Library/Android/sdk/ndk/android-ndk-r15c/sources/cxx-stl/llvm-libc++/include/stdexcept:116:63: error: unknown type name 'string'
_LIBCPP_INLINE_VISIBILITY explicit invalid_argument(const string& __s) : logic_error(__s) {}
^
/Users/fredrodrigues/Library/Android/sdk/ndk/android-ndk-r15c/sources/cxx-stl/llvm-libc++/include/stdexcept:126:59: error: unknown type name 'string'
_LIBCPP_INLINE_VISIBILITY explicit length_error(const string& __s) : logic_error(__s) {}
^
/Users/fredrodrigues/Library/Android/sdk/ndk/android-ndk-r15c/sources/cxx-stl/llvm-libc++/include/stdexcept:136:59: error: unknown type name 'string'
_LIBCPP_INLINE_VISIBILITY explicit out_of_range(const string& __s) : logic_error(__s) {}
^
/Users/fredrodrigues/Library/Android/sdk/ndk/android-ndk-r15c/sources/cxx-stl/llvm-libc++/include/stdexcept:146:58: error: unknown type name 'string'
_LIBCPP_INLINE_VISIBILITY explicit range_error(const string& __s) : runtime_error(__s) {}
^
/Users/fredrodrigues/Library/Android/sdk/ndk/android-ndk-r15c/sources/cxx-stl/llvm-libc++/include/stdexcept:156:61: error: unknown type name 'string'
_LIBCPP_INLINE_VISIBILITY explicit overflow_error(const string& __s) : runtime_error(__s) {}
^
/Users/fredrodrigues/Library/Android/sdk/ndk/android-ndk-r15c/sources/cxx-stl/llvm-libc++/include/stdexcept:166:62: error: unknown type name 'string'
_LIBCPP_INLINE_VISIBILITY explicit underflow_error(const string& __s) : runtime_error(__s) {}
If I remove ofxPoco from my addons.mk file then I can compile and run the apps on my device or simulator.
I am using Android studio 3.14 and android-ndk-r15c as advised.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the ofxPoco build with the Android Studio and android-ndk-r15c setup described, then inspect the project's addons.mk configuration and the reported libc++ errors. Done means an Android project using ofxPoco compiles and runs without removing the addon from addons.mk.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, cpp
- Domain
- build-system, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100