Revision history [back]

click to hide/show revision 1
initial version

Getting undefined reference to 'typeinfo for ajn::BusObject

When I build my Android app by using Android NDK and disabling RTTI (by setting -fno-rtti in Application.mk) I can use Alljoyn Android library without any problems.

But in my project I need to use RTTI (by setting -frtti). Now I get this error when trying to build:

:typeinfo for hello::ChatObject: error: undefined reference to 'typeinfo for ajn::BusObject

I did some googling and think I have an idea of what the problem is. I can force the error by doing something like this:

class TestA
{
public:
    TestA() {}
    virtual void abc();
};

class TestB : public TestA
{
public:
    TestB() {}
    void abc() {}
};

But the error disappears when setting the method to pure virtual like so in TestA in the example above:

virtual void abc() = 0;

I can see that BusObject has some methods that are not implemented in the BusObject.h header file and are not pure virtual. I am not sure if some of the methods are implemented in a corresponding BusObject.cpp file or not.

For me to be able to finish my project I would like an update in BusObject.h so that all methods are either having a dummy implementation or are set to pure virtual so I can override them in my child class.

Can this be done?