Getting undefined reference to 'typeinfo for ajn::BusObject

asked 2015-04-03 13:44:34 -0700

scrib gravatar image

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
    TestA() {}
    virtual void abc();

class TestB : public TestA
    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?

edit retag flag offensive close merge delete


What version of AllJoyn are you using? Really old versions of AllJoyn used to build with -fno-rtti but newer versions don't. The current version of the library should be built with RTTI support though AllJoyn itself does not use it itself.

stevek ( 2015-04-06 12:14:55 -0700 )edit

I am using 14.12.00b for Android that can be downloaded from https://allseenalliance.org/developers/download. It is the newest one, isn't it? Anyway, I was having problems when using Chaiscript (requires RTTI) in the same project. I am going with Angelscript instead so I can build without RTTI.

scrib ( 2015-04-10 23:42:11 -0700 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2015-04-13 08:54:32 -0700

stevek gravatar image

When AllJoyn is built for Android it uses ndk-build to determine the build flags that should be used for building AllJoyn for Android so that AllJoyn will not have any incompatibilities with the system libraries in Android. One of these flags that ndk-build specifies is the '-no-rtti' flag which disables RTTI information in the AllJoyn libraries. I'm not familiar with Chaiscript, but if it requires RTTI, then I suspect it may have problems running on Android anyway.

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-04-03 13:44:34 -0700

Seen: 148 times

Last updated: Apr 13 '15