DNNLibrary
DNNLibrary copied to clipboard
error: use of undeclared identifier '__ANDROID_API_Q__'
trafficstars
Problem
Per README:
... you need Android NDK, r17b or higher NDK is necessary
But in fact, in code used definition which available only in r19 https://github.com/JDAI-CV/DNNLibrary/blob/master/dnnlibrary/ModelBuilder.cpp#L358
Workaround
Pass -D__ANDROID_API_Q__=29 to preprocessor
Long-term solution
To me, the idea of using __ANDROID_API_XXX__ looks great, so maybe it will be good to wrap up this if with
#ifndef __ANDROID_API_Q__
return return dnn::nullopt;
#else
...
#endif
P.S. You may ask "Wouldn't it be easier to upgrade the NDK?" and generally answer is yes but sometimes project have a strong dependency on specific NDK revision or use custom "non-vanilla" NDK
I can help with preparing PR if a general idea is good, or with any other suggested way