DNNLibrary icon indicating copy to clipboard operation
DNNLibrary copied to clipboard

error: use of undeclared identifier '__ANDROID_API_Q__'

Open CAMOBAP opened this issue 5 years ago • 0 comments
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

CAMOBAP avatar Apr 14 '20 07:04 CAMOBAP