Template in Android NDK

55 views
Skip to first unread message

ra...@cin.ufpe.br

unread,
Feb 12, 2018, 3:05:59 PM2/12/18
to android-ndk

Hello there!

I'm trying to compile a library for Android that is in C++. It is implemented in .h and .hpp files. I included the folder that have all the files. I'm using Android Studio 3.0.1 and NDK r16b with Clang 5.0.300080 compiler. However, I'm having the following error with some functions:

error: use of undeclared identifier 'ExistChild'

It uses the ExistChild function in the KdTree class, which inherits the class BaseTree, which implements this function. 

class KdTree
: public StrategiesT::template StrategyBase
    <
        MetricT
        <
            VectorKernelT
            <
                BaseTree
                <
                    KdTreeCell< typename StrategiesT::CellData >
                >
            >
        >
    >
{
    ...
};

Since this code compiles in Visual Studio, I suspect that the problem may be that the Android C++ compiler does not support this kind of template specialization. I searched around and I couldn't find any information that confirms or denies this.

Does anybody encounter this problem before?

Best, Rafael!

Alex Cohn

unread,
Feb 15, 2018, 4:07:24 AM2/15/18
to android-ndk
Hi,

Maybe you need to set -std=c++14 ?

BR,
Alex

Rafael Alves Roberto

unread,
Feb 15, 2018, 4:03:21 PM2/15/18
to android-ndk
Hi Alex,

thanks for the suggestion, but I am still having the same error using c++14. Right now, I'm trying to compile this library for desktop platform using the same Clang compiler to rule out the possibility of incompatibility between this code and this specific compiler.

Best,
Rafael
Reply all
Reply to author
Forward
0 new messages