Q:

How to register a new class (new application) in Omnet++

I have the code below, but when I run the simulation I got this error :
Class "myApp" not found -- perhaps its code was not linked in, or the class wasn't registered with Register_Class().
#ifndef MYAPP_H_
#define MYAPP_H_

#include "inet/applications/udpapp/UdpBasicApp.h"
#include <omnetpp.h>

using namespace omnetpp;
using namespace inet;

class myApp : public UdpBasicApp
{

};

Define_Module(myApp);

#endif /* MYAPP_H_ */

package saas;
import inet.applications.udpapp.UdpBasicApp;

simple myApp extends UdpBasicApp{
    @class(myApp);
}

A:

Define_Module(myApp);

should go into the C++ file along with the implementation (which is also missing from the above listing) and not in the header.

