How To Solve Class Not Found Problem in OMNeT++
If you are new to Omnet, it is possible to do some mistakes when you are coding your first program. I used to TOSSIM for some months, then I have started to use Omnet. When I am coding my first program on Omnet, I got this problem at first start to simulating code :
In this article, I focused an other reason which is caused this problem.
For example, we assume, our code is like this in the .NED file:
Lets look at another code snippet which is written in .CC file :
You must care of the name of this class. If you give same names to these classes, you don't get any error message. If you give different name, you will get error message included "class not found".
Error in module (omnetpp::cModule) ag (id=1) during network setup: Class "blogkafem" not found -- perhaps its code was not linked in, or the class wasn't registered with Register_Class(), or in the case of modules and channels, with Define_Module()/Define_Channel().At first you suppose this problem caused by linked problem of Eclipse (it is avaible and default omnet editor). Almost, all of the web sites are focusing on this sitution to solve this problem (you probably know, if you had searched on google). This approach is prettym much correct.
In this article, I focused an other reason which is caused this problem.
For example, we assume, our code is like this in the .NED file:
simple blogkafemPay attention to name of the class. Its name is "blogkafem".
{
gates:
input in;
output out;
}
Lets look at another code snippet which is written in .CC file :
class blogkafem : public cSimpleModule{Pay attention again to name of the class. Its name is "blogkafem".
protected:
virtual void initialize();
virtual void handleMessage(cMessage *msg);
};
You must care of the name of this class. If you give same names to these classes, you don't get any error message. If you give different name, you will get error message included "class not found".
awesome, that error is gone now
ReplyDeleteyep, that's awesome :) thanks for your valuable comment :)
Delete