'Cannot add multiple .ned directory when running omnet++ from its own shell
I want to run my simulation without opening the IDE. I checked the manual and follow the steps but I got stucked.
I am using omnetpp v5.6.2. I run mingwenv.cmd in the directory where my *.ini is and type this:
AFDX.exe -f C:/Workspaces/Github/AFDX/Simulations/AutoNetwork.ini -n C:/Workspaces/Github/AFDX/simulations
I got this in return:
OMNeT++ Discrete Event Simulation (C) 1992-2019 Andras Varga, OpenSim Ltd.
Version: 5.6.2, build: 200518-aa79d0918f, edition: Academic Public License -- NOT FOR COMMERCIAL USE
See the license for distribution terms and warranty disclaimer
Setting up Qtenv...
Loading NED files from C:/Workspaces/Github/AFDX/simulations: 1
Loading images from 'bitmaps': *: 0
Loading images from 'images': *: 0
Loading images from 'C:/omnetpp-5.6.2/images': *: 0 abstract/*: 90 background/*: 4 block/*: 320 device/*: 195 logo/*: 1 maps/*: 9 misc/*: 70 msg/*: 55 old/*: 111 status/*: 28
and this:
So I added my src directory too
AFDX.exe -f C:/Workspaces/Github/AFDX/Simulations/AutoNetwork.ini -n "C:/Workspaces/Github/AFDX/simulations;C:/Workspaces/Github/AFDX/src"
This time I make it count all the ned files but still didn't work:
OMNeT++ Discrete Event Simulation (C) 1992-2019 Andras Varga, OpenSim Ltd.
Version: 5.6.2, build: 200518-aa79d0918f, edition: Academic Public License -- NOT FOR COMMERCIAL USE
See the license for distribution terms and warranty disclaimer
Setting up Qtenv...
Loading NED files from C:/Workspaces/Github/AFDX/simulations: 1
Loading NED files from C:/Workspaces/Github/AFDX/src: 38
Loading images from 'bitmaps': *: 0
Loading images from 'images': *: 0
Loading images from 'C:/omnetpp-5.6.2/images': *: 0 abstract/*: 90 background/*: 4 block/*: 320 device/*: 195 logo/*: 1 maps/*: 9 misc/*: 70 msg/*: 55 old/*: 111 status/*: 28
As opposed to the error, there is an AFDX::ConnDef class actually and when I run the simulation by using the IDE, it works just fine.
I am adding my project directory structure too, maybe it'll help.
|>AFDX
__|>src
____|>queueinglib
______| *.ned
______| *.cc
______| *.h
____| *.ned
____| *.cc
____| *.h
____| ConnDef stuff is here
__|>simulations
____|>Results
____|AFDX.exe
____|AutoNetwork.ini
____|AutoNetwork.ned
____|Makefile
__|Makefile
Solution 1:[1]
This question contains 2 problems. The first was properly solved by you. The second (afdx::ConnDef not found). Has absolutely nothing to do with the title of this question or with NED files in general. The ConnDef class is either missing from the c++ code, or you forgot to add the Define_Module macro, or you put that class into the global namespace instead of including it the afdx namespace.
You are suggesting that you get different results running from IDE or the commandline. This can be only, of you actually run different executables.
Checking your directory tree shows that you have a Makefile and the 'AFDX.exe' file in the simulations folder, so that folder is designated as source folder, however it does NOT have any source files in it. On the other hand, src folder is also a source folder and while you have not indicated, I believe it also has a Makefile and again an EXE file, and that is the executable that contains your model code and the afdx::ConnDef class (and the IDE also starts that executable). On the other hand, you are launching the EXE file from the simulations folder which is an empty exe without any code...
Do NOT use two source folders in a project at the same time unless you really now what you are doing. Just remove the source designation from the simulations folder and delete the exe and Makefile there.
Use the EXE in the src folder to start the sim from command-line. i.e. you would do something like
cd simulations
../src/AFDX.exe -n ".;../src" AutoNetwork.ini
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |


