C++ class not found when running OMNET++ project

477 views
Skip to first unread message

Gérard KPONHINTO

unread,
May 26, 2021, 11:36:51 AM5/26/21
to OMNeT++ Users
Hi community

Please someone could help me to fix my issue? I will be very grateful.

I try to implement LEACH PROTOCOL. So I added a simple module named Leach to the INET compound module SensorNode. Now I'm implementing my protocol in C++ by creating the Leach.h and Leach.cc files. My Leach class is well registered with OMNET++ via the command Define_Module(Leach); but when running the project, I got the error as it appears on this image :

Capture.PNG

Here is the inside of my sensor node with the position of my Leach simple module: 

leachprotocol.png

Similar questions are asked here OMNET++: Class not Found --perhaps code is not linked or the class was not registered But what they advise doesn't sort out my concern.

Please looking forward to your input.

I'm using OMNET++6.0preview10 with INET 4.3


Best regards !

Alfonso Ariza Quintana

unread,
May 27, 2021, 4:00:10 AM5/27/21
to omn...@googlegroups.com
I think that you have a problem with the namespaces. Omnet is searching the module Leach in the namespace leach, you should verify if the module Leach is inside this namespace or is in other namespace

De: omn...@googlegroups.com <omn...@googlegroups.com> en nombre de Gérard KPONHINTO <kponhi...@gmail.com>
Enviado: miércoles, 26 de mayo de 2021 17:36
Para: OMNeT++ Users <omn...@googlegroups.com>
Asunto: [Omnetpp-l] C++ class not found when running OMNET++ project
 
--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/dc92b9ca-1ed2-4e48-b599-335bc5b9400fn%40googlegroups.com.

Gérard KPONHINTO

unread,
May 29, 2021, 12:39:02 AM5/29/21
to OMNeT++ Users
Many thanks, Alfonso for your input.

It's really a problem with namespaces. 

I specified inet namespace for all C++ files and the error is fixed.

Reply all
Reply to author
Forward
0 new messages