I'm simulating a network in OMNeT++, with INET framework. I have a compound module as network node, consisting of a simple module/node and the mobility module. I want to get the position of the node with the following code:
void node::initialize()
{
cModule *host = getContainingNode(this);
IMobility *mobility = check_and_cast<IMobility *>(host->getSubmodule("mobility"));
Coord selfPosition = mobility->getCurrentPosition();
}
I've also included "inet/mobility/contract/IMobility.h".
It should be straightforward, but the build fails with the following:
../out/clang-release/src/node.o:(.text[_ZN7omnetpp14check_and_castIPN4inet9IMobilityENS_7cModuleEEET_PT0_]+0x18): undefined reference to `__imp__ZTIN4inet9IMobilityE'
../out/clang-release/src/node.o:(.rdata[_ZTIPN4inet9IMobilityE]+0x18): undefined reference to `typeinfo for inet::IMobility'
I understand that this has something to do with the compiler, but it's not clear how I can solve this within OMNeT++ environment. Any ideas?