Error: cannot resolve module type `Router'

884 views
Skip to first unread message

Alberto Cortés

unread,
Nov 30, 2009, 12:07:36 PM11/30/09
to omn...@googlegroups.com
Hello, I'm an Omnet++ newbie.

I have this simple ned file:
#####################
import inet.nodes.inet.Router;

network scenario01
{
submodules:
router0: Router {
parameters:
gates:
pppg[1];
}

router1: Router {
parameters:
gates:
pppg[1];
}

connections:
router0.pppg[0] <--> {delay=10ms;} <--> router1.pppg[0];
}
####################



And this simple omnet.ini file:
###################################
[General]
network = scenario01
###################################



I make the Makefile with:
##################
alcortes@bat:~/local/learning/omnetpp/test; opp_makemake -f --deep -O
out -L/home/alcortes/local/omnetpp-inet/inet-framework-inet-d98efa8/out/gcc-debug/src
-linet -KINET_PROJ=/home/alcortes/local/omnetpp-inet/inet-framework-inet-d98efa8
-u Cmdenv -o run
Creating Makefile in /home/alcortes/local/learning/omnetpp/test...
Makefile created, running "make depend" to add dependencies...
opp_makedep -Y --objdirtree -I. -f Makefile -P\$O/ -- ./*.cc
opp_makedep: warning: no input files
##################
(I have take this opp_makemake options from a successfully compilation
and execution in the omnet++ IDE, but I can't find how to use
opp_makemake with the INET framework in the documentation)


I compile and run and get the following error:
###############################
alcortes@bat:~/local/learning/omnetpp/test; make
g++ -Wl,-rpath,/home/alcortes/local/omnetpp/4.0/vanilla/omnetpp-4.0/lib:.
-o out/gcc-debug//run -Wl,--whole-archive
-L/home/alcortes/local/omnetpp-inet/inet-framework-inet-d98efa8/out/gcc-debug/src
-linet -Wl,-rpath,`abspath
/home/alcortes/local/omnetpp-inet/inet-framework-inet-d98efa8/out/gcc-debug/src`
-Wl,--no-whole-archive
-L"/home/alcortes/local/omnetpp/4.0/vanilla/omnetpp-4.0/lib/gcc"
-L"/home/alcortes/local/omnetpp/4.0/vanilla/omnetpp-4.0/lib" -u
_cmdenv_lib -loppcmdenvd -loppenvird -loppsimd -ldl -lstdc++
ln -s -f out/gcc-debug//run .
alcortes@bat:~/local/learning/omnetpp/test; ./run
OMNeT++ Discrete Event Simulation (C) 1992-2008 Andras Varga, OpenSim Ltd.
Version: 4.0, build: 090310-10709, edition: Academic Public License --
NOT FOR COMMERCIAL USE
See the license for distribution terms and warranty disclaimer
Setting up Cmdenv...
Loading NED files from .: 1

Preparing for running configuration General, run #0...
Scenario: $repetition=0
Assigned runID=General-0-20091130-17:52:36-8459
Setting up network `scenario01'...

<!> Error in module (cCompoundModule) scenario01 (id=1): Submodule
router0: cannot resolve module type `Router' (not in the loaded NED
files?), at /home/alcortes/local/learning/omnetpp/test/scenarios.ned:6.


End.
###############################

I'm using:
- omnetpp version 4.0
- inet framework d98efa8 (2009-11-28 )

I can run and watch the omnet and inet framework demos, so I think
they were successfully installed.

I think the error comes from not knowing how to tell opp_makemake to
find the INET framework libraries. Any hints?



--
Alberto Cortés
Telematic Engineering Dept. at UC3M

Alfonso Ariza

unread,
Nov 30, 2009, 1:44:41 PM11/30/09
to omn...@googlegroups.com
Sorry to everybody I'm going to answer this question in Spanish


Te contesto en castellano,

Es un problema de rutas, no puede encontrar las rutas a los ficheros ned que
est嚙編 usando (Router.ned). Puedes a嚙窮dir la de b嚙編queda en el fichero ini
para indicar donde tiene que buscar los ficheros .ned mira en la seccion 9
del manual "Specifying the NED path"

De todas maneras ten cuidado con la librer嚙窮 inet.so en unix o inet.dll en
windows. Es en esa librer嚙窮 donde est嚙�el c嚙範igo ejecutable del router y por
lo tanto tambi嚙緯 tienes que indicar como acceder a ella.

Lo mas sencillo, si tu red usan el c嚙範igo del inet-framwork, es que pongas
tus ejemplos dentro del directorio examples y copies el fichero run de
cualquiera de los otros ejemplos. Con eso te garantizar嚙編 que tus ejemplos
encuentre la librer嚙窮 inet.so y los ficheros ned.


--------------------------------------------------
From: "Alberto Cort嚙編" <alco...@it.uc3m.es>
Sent: Monday, November 30, 2009 6:07 PM
To: <omn...@googlegroups.com>
Subject: [Omnetpp-l] Error: cannot resolve module type `Router'
> Alberto Cort嚙編
> Telematic Engineering Dept. at UC3M
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "omnetpp" group.
> To post to this group, send email to omn...@googlegroups.com.
> To unsubscribe from this group, send email to
> omnetpp+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/omnetpp?hl=en.
>
>
>

Alberto Cortés

unread,
Nov 30, 2009, 5:21:50 PM11/30/09
to omn...@googlegroups.com
Fixed!

I will translate (an abstract of) Alfonso's answer to english and
explain how I solved the problem:

Alfonso wrote something like this:
##########
You have a problem with the NED_PATH. Learn more about the NED_PATH
at the section 9 of the manual: "Specifying the NED path".

You can define the NED_PATH inside the ini file. Take care to
include all the INET neds files in the NED_PATH.

The easiest way to go with the INET framework is to include your
code in the examples directory of the INET framework and reuse some of
its ./run files.
###########

Alfonso was right, I had a problem with the NED_PATH. I overwrote the
NED_PATH using the ned-path comfiguration option in the ini file:
###################################
[General]
network = scenario01
ned-path = /home/alcortes/local/omnetpp-inet/inet-framework-inet-d98efa8/src/;.
###################################

Notice the . after the INET framework directory, that way I can also
use my own ned files in the current directory.

PS: I prefer this solution to moving my code to the INET framework
example dir, because I don't like to use the INET framework examples
dir as my playing ground.

PPS: ¡Gracias Alfonso!





On Mon, Nov 30, 2009 at 7:44 PM, Alfonso Ariza <aari...@hotmail.com> wrote:
> Sorry to everybody I'm going to answer this question in Spanish
>
>
> Te contesto en castellano,
>
> Es un problema de rutas, no puede encontrar las rutas a los ficheros ned que
> estás usando (Router.ned).  Puedes añadir la de búsqueda en el fichero ini
> para indicar donde tiene que buscar los ficheros .ned mira en la seccion 9
> del manual "Specifying the NED path"
>
> De todas maneras ten cuidado con la librería inet.so en unix o inet.dll en
> windows. Es en esa librería donde está el código ejecutable del router y por
> lo tanto también tienes que indicar como acceder a ella.
>
> Lo mas sencillo, si tu red usan el código del inet-framwork, es que pongas
> tus ejemplos dentro del directorio examples y copies el fichero run de
> cualquiera de los otros ejemplos. Con eso te garantizarás que tus ejemplos
> encuentre la librería inet.so y los ficheros ned.
>
>
> --------------------------------------------------
> From: "Alberto Cortés" <alco...@it.uc3m.es>
>> Alberto Cortés
>> Telematic Engineering Dept. at UC3M
>>
>> --
>>
>> You received this message because you are subscribed to the Google Groups
>> "omnetpp" group.
>> To post to this group, send email to omn...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> omnetpp+u...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/omnetpp?hl=en.
>>
>>
>>
>
> --
>
> You received this message because you are subscribed to the Google Groups "omnetpp" group.
> To post to this group, send email to omn...@googlegroups.com.
> To unsubscribe from this group, send email to omnetpp+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/omnetpp?hl=en.
>
>
>



--
Alberto Cortés

Kleinmann

unread,
Feb 18, 2012, 11:47:14 AM2/18/12
to omn...@googlegroups.com
I encountered the same problem. However when using the NED_PATH with
inet.nodes.inet, I got the following error "declared package '
inet.nodes.inet' does not match expected package"
Any idea how to overcome this?
Amit.


Fixed!

PPS: ¡Gracias Alfonso!

On Mon, Nov 30, 2009 at 7:44 PM, Alfonso Ariza <aariza...@hotmail.com>


wrote:
> Sorry to everybody I'm going to answer this question in Spanish

> Te contesto en castellano,

> Es un problema de rutas, no puede encontrar las rutas a los ficheros ned que
> estás usando (Router.ned).  Puedes añadir la de búsqueda en el fichero ini
> para indicar donde tiene que buscar los ficheros .ned mira en la seccion 9
> del manual "Specifying the NED path"

> De todas maneras ten cuidado con la librería inet.so en unix o inet.dll en

> windows. Es en esa librería donde está el código ejecutable delroutery por


> lo tanto también tienes que indicar como acceder a ella.

> Lo mas sencillo, si tu red usan el código del inet-framwork, es que pongas
> tus ejemplos dentro del directorio examples y copies el fichero run de
> cualquiera de los otros ejemplos. Con eso te garantizarás que tus ejemplos
> encuentre la librería inet.so y los ficheros ned.

> --------------------------------------------------
> From: "Alberto Cortés" <alcor...@it.uc3m.es>


> Sent: Monday, November 30, 2009 6:07 PM
> To: <omn...@googlegroups.com>

> Subject: [Omnetpp-l] Error:cannotresolvemoduletype`Router'

>> router0:cannotresolvemoduletype`Router' (not in the loaded NED
>> files?), at /home/alcortes/local/learning/omnetpp/test/scenarios.ned:6.

>> End.
>> ###############################

>> --

> --

> For more options, visit this group athttp://groups.google.com/group/omnetpp?hl=en.

Alberto Cortés

unread,
Feb 19, 2012, 1:39:03 PM2/19/12
to omn...@googlegroups.com
No idea, sorry, it looks like you are not facing the same problem that I was.

Please note that I posted the full contents of all my files and the
Inet version I was using.

Have you try to reproduce my problem instead of yours?, you will
notice the differences between them and you will realize why my
solution didn't solve your problem.

Regards.

> --
> Sent from the OMNeT++ mailing list. To configure your membership,
> visit http://groups.google.com/group/omnetpp

--
Alberto Cortés-Martín


Telematic Engineering Dept. at UC3M

http://www.it.uc3m.es/alcortes/index.html

Kleinmann

unread,
Feb 19, 2012, 7:22:55 PM2/19/12
to omnetpp
Thanks to an offline correspondence I had with Alberto, who
recommended me to read carefully on Omnet++ packages, I overcame this
problem.
It appears that in the NED_PATH you need to put the directory where
the the root "package.ned" file is located.

So I made a step forward toward the batch execution of my project
(that uses INET modules).
My next problem is that I get the following error

<!> Error in module (cCompoundModule) ... (id=1) during network setup:
Class "FlatNetworkConfigurator" 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().

Any help will be appreciated,

Amit
> > visithttp://groups.google.com/group/omnetpp

Kleinmann

unread,
Feb 20, 2012, 4:43:59 AM2/20/12
to omnetpp
Hi All,
I continued researching for a solution and I would like to report the
group about my findings:
It seems that there was a problem in earlier versions of Omnet++
related to "Switching a shared library based model to release mode
from debug prevents the running of model" But it was reported that it
was solved in version 4.2. I am using the latest Omnet++ version (as
of today 4.2.1), so it should not be this issue.

I also checked my script on a unix machine, and ... it works! So the
problem I encounter is only under Windows when invoking the script
under mingw32 (while I can run my simulation successfully from the IDE
even in command line).

Anyhow, I need this for a unix env. so for me this is good enough.

Thanks again to Alberto for his hint.

Amit.
Reply all
Reply to author
Forward
0 new messages