Dear All,
I recently started the migration of my simulation code base to 4.x platform and faced the following errors:
============================================================================
**** Build of configuration gcc-debug for project success ****
make MODE=debug CONFIGNAME=gcc-debug all
g++ -c -gstabs+ -Wall -fno-stack-protector -I/usr/include -DHAVE_PCAP -DXMLPARSER=libxml -DWITH_PARSIM -DWITH_NETBUILDER -I. -Ie:/Tools/omnetpp/include -o out/gcc-debug//scheduler.o scheduler.cc
scheduler.cc: In function 'cObject* __uniquename_22()':
scheduler.cc:22: error: cannot allocate an object of abstract type 'Scheduler'
scheduler.h:29: note: because the following virtual functions are pure within 'Scheduler':
scheduler.h:94: note: virtual void Scheduler::handleMessage(cMessage*)
scheduler.h:75: note: virtual void Scheduler::handleGrant(int, SuccessFrame*)
scheduler.h:76: note: virtual void Scheduler::initializeSpecific()
scheduler.h:77: note: virtual void Scheduler::finishSpecific()
scheduler.h:87: note: virtual void Scheduler::receiveIpPacket(IpPacket*)
make: *** [out/gcc-debug//scheduler.o] Error 1
============================================================================
Here is the relevant snippet of 'Scheduler' class declaration:
============================================================================
...
virtual void handleGrant(int lambda, SuccessFrame *grant) = 0; // pure virtual function
virtual void initializeSpecific(void) = 0; // "
virtual void finishSpecific(void) = 0; // "
...
virtual void receiveIpPacket(IpPacket *msg) = 0; // pure virtual function
...
virtual void handleMessage(cMessage *msg) = 0; // pure virtual function
============================================================================
This 'Scheduler' is a base class from which many other scheduler classes are derived (using "Define_Module" and "Define_Module_Like" macros in 3.xx).
The above codes work just fine with 3.xx (till 3.4b2), but with 4.xx release, I couldn't find detailed information on module inheritance mechanism especially in the manual. All I found is the following line in Sec. 4.2.1:
============================================================================
[For completeness, there is also a Define_Module_Like()
macro, but its use is discouraged and might even be removed in
future OMNeT++ releases.]============================================================================
Because I heavily depend on the inheritance mechansim to test and compare various algorithms, more details (in addition to a brief sketch provided in "Migrating ... To 4.0") would be highly appreciated.
Regards,
Joseph
--
Dr. Kyeong Soo (Joseph) Kim
Senior Lecturer
Institute of Advanced Telecommunications, Swansea University
Singleton Park, Swansea SA2 8PP, Wales UK
+44 (0)1792 602024 (Office) / 602449 (Fax)
k.s...@swansea.ac.uk /
http://iat-hnrl.swan.ac.uk/~kks/