Error on executing the simulation: "Class xxxxxx not found".

52 views
Skip to first unread message

Luis Henrique

unread,
Aug 29, 2015, 10:06:46 AM8/29/15
to OMNeT++ Users
Greetings. 

I'm building a simulation with two node types: one that reads data from the environment and the other that stores this data to a MySQL DB. As for coding, the project compiles with no errors of any kind, but when running the simulation I got the following message at the very beginning:



Happens that the class is registered with Define_Module() and I tried with Register_Class() too, but neither worked. I've found some people with the same problem but the sollution they got did not worked for me, so I'm bringing it to a new thread. 


The code for the simulation and it's nodes is attached. The system running Omnet is Ubuntu 15.04 64 bits.




dbSyncSensor.c
dbWrite.h
defaultSensor.c
omnetpp.ini
redeSensores.ned

Ester Lopez

unread,
Aug 29, 2015, 1:21:04 PM8/29/15
to OMNeT++ Users
Could it be because of the naming? I always have a .h and .cc (or cpp) for each simple module, and thought that was how omnet++ knew how to find which files to compile... But Im not 100% sure... maybe check your Makefile and make sure that you are compiling dbSyncSensor.c?

--
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.
Visit this group at http://groups.google.com/group/omnetpp.
For more options, visit https://groups.google.com/d/optout.

Luis Henrique

unread,
Aug 29, 2015, 1:43:51 PM8/29/15
to OMNeT++ Users
Hi there. 

Did the proposed filename changes but the error message persists. Didn't found anything wrong with Makefile also (is attached). 
makefile.txt

Ester Lopez

unread,
Aug 29, 2015, 1:59:24 PM8/29/15
to OMNeT++ Users
Isn't it missing the default sensor?
I believe it should be:

# Object files for local .cc and .msg files
OBJS = $O/dbSyncSensor.o $O/defaultSensor.o
[...]
# DO NOT DELETE THIS LINE -- make depend depends on it.
$O/dbSyncSensor.o: dbSyncSensor.cc \
dbWrite.h
$O/defaultSensor.o: defaultSensor.cc



Luis Henrique

unread,
Aug 29, 2015, 2:12:27 PM8/29/15
to OMNeT++ Users
The proposed changes generates the same error message, but this time related to defaultSensor:


Also, after I tried to run the simulation, the changes that was made to makefile were undone by the program and the file returned to his previous state (before being modified). After that if I try to run the simulation again it keeps saying the error message that the defaultSensor class is not found, rather than the dbSyncSensor =|

Ester Lopez

unread,
Aug 29, 2015, 2:21:45 PM8/29/15
to OMNeT++ Users
Did you also change defaultSensor.c to defaultSensor.cc? I had no issues with the following project structure:

ester@lenovo:~/omnetpp-4.6/samples/proba$ ls
dbSyncSensor.cc  defaultSensor.cc  omnetpp.ini  proba   redeSensores.ned
dbWrite.h        Makefile          out          README


Ester Lopez

unread,
Aug 29, 2015, 2:23:09 PM8/29/15
to OMNeT++ Users
Ah, I forgot, I had to add "allowunconnected" to RedeSensores:
    connections allowunconnected:

And delete the package line.

Luis H. Forchesatto

unread,
Aug 31, 2015, 3:42:12 PM8/31/15
to omn...@googlegroups.com

Greetings.

 

- renamed “defaultSensor.c” to “defaultSensor.cc” and it worked.

- added “allowunconnected” and the error regarding gates unused stopped showing.

 

Thank you again for guiding me on these problems.

 

Hope the group don’t mind me posting more questions like these, I’m making my term paper based on Omnet and it’s been a little hard.

 

Best regards.

Reply all
Reply to author
Forward
0 new messages