1
votes

I am trying to build and simulate a project that references INET (the INETWirelessTutorial actually), however I get the error below that says " Error: Cannot load library '../inet/src//libINET.dll': A dynamic link library (DLL) initialization routine failed". My project WireTryLiveson references project INET. I wonder if I need to link path environment variables differently? I tried the following:

  1. Open "RSVPPacket.msg", modify it then change it back, and save it (which was suggested by a google group when I searched "libinet.dll")
  2. Build INET

Neither seemed to work. INET Example projects simulate just fine.

What should I change so I can load libINET.dll?

You can see the libINET.dll here on the Project Explorer on the left.

Here are my environment variables.

Here's what the OMNET++ Console displays with my error:

Starting...

$ cd C:/inetModule/WireTryLiveson
$ WireTryLiveson.exe -m -n .;../inet/src;../inet/examples;../inet/tutorials;../inet/showcases --image-path=../inet/images -l ../inet/src/INET omnetpp.ini

OMNeT++ Discrete Event Simulation  (C) 1992-2017 Andras Varga, OpenSim Ltd.
Version: 5.1.1, build: 170508-adbabd0, edition: Academic Public License -- NOT FOR COMMERCIAL USE
See the license for distribution terms and warranty disclaimer


<!> Error: Cannot load library '../inet/src//libINET.dll': A dynamic link library (DLL) initialization routine failed

End.

Simulation terminated with exit code: -1073741819
Working directory: C:/inetModule/WireTryLiveson
Command line: WireTryLiveson.exe -m -n .;../inet/src;../inet/examples;../inet/tutorials;../inet/showcases --image-path=../inet/images -l ../inet/src/INET omnetpp.ini

Environment variables:
PATH=;C:/inetModule/inet/src;C:\omnetpp-5.1.1-src-windows\omnetpp-5.1.1\bin;C:\omnetpp-5.1.1-src-windows\omnetpp-5.1.1\tools\win64\mingw64\bin;C:\omnetpp-5.1.1-src-windows\omnetpp-5.1.1\tools\win64\usr\bin;;C:/omnetpp-5.1.1-src-windows/omnetpp-5.1.1/ide/jre/bin/server;C:/omnetpp-5.1.1-src-windows/omnetpp-5.1.1/ide/jre/bin;C:/omnetpp-5.1.1-src-windows/omnetpp-5.1.1/ide/jre/lib/amd64;.;C:\omnetpp-5.1.1-src-windows\omnetpp-5.1.1\bin;C:\omnetpp-5.1.1-src-windows\omnetpp-5.1.1\tools\win64\mingw64\bin;C:\omnetpp-5.1.1-src-windows\omnetpp-5.1.1\tools\win64\usr\local\bin;C:\omnetpp-5.1.1-src-windows\omnetpp-5.1.1\tools\win64\usr\bin;C:\omnetpp-5.1.1-src-windows\omnetpp-5.1.1\tools\win64\usr\bin;C:\Windows\System32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\omnetpp-5.1.1-src-windows\omnetpp-5.1.1\tools\win64\usr\bin\site_perl;C:\omnetpp-5.1.1-src-windows\omnetpp-5.1.1\tools\win64\usr\bin\vendor_perl;C:\omnetpp-5.1.1-src-windows\omnetpp-5.1.1\tools\win64\usr\bin\core_perl;C:\omnetpp-5.1.1-src-windows\omnetpp-5.1.1;
OMNETPP_ROOT=C:/omnetpp-5.1.1-src-windows/omnetpp-5.1.1/
OMNETPP_IMAGE_PATH=C:\omnetpp-5.1.1-src-windows\omnetpp-5.1.1\images

Here's my omnetpp.ini:

[General]
network = WirelessTry
sim-time-limit = 25s
*.host*.networkLayer.arpType = "GlobalARP"
*.hostA.numUdpApps = 1
*.hostA.udpApp[0].typename = "UDPBasicApp"
*.hostA.udpApp[0].destAddresses = "hostB"
*.hostA.udpApp[0].destPort = 5000
*.hostA.udpApp[0].messageLength = 1000B
*.hostA.udpApp[0].sendInterval = exponential(12ms)
*.hostA.udpApp[0].packetName = "UDPData"
*.hostB.numUdpApps = 1
*.hostB.udpApp[0].typename = "UDPSink"
*.hostB.udpApp[0].localPort = 5000
*.host*.wlan[0].typename = "IdealWirelessNic"
*.host*.wlan[0].mac.useAck = false
*.host*.wlan[0].mac.fullDuplex = false
*.host*.wlan[0].radio.transmitter.communicationRange = 500m
*.host*.wlan[0].radio.receiver.ignoreInterference = true
*.host*.**.bitrate = 1Mbps

Here's my file wirelessTry.ned:

import inet.common.figures.DelegateSignalConfigurator;
import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
import inet.node.inet.INetworkNode;
import inet.physicallayer.contract.packetlevel.IRadioMedium;
import inet.visualizer.integrated.IntegratedCanvasVisualizer;
network WirelessTry
{
    parameters:
        string hostType = default("WirelessHost");
        string mediumType = default("IdealRadioMedium");
        @display("bgb=650,500;bgg=100,1,grey95");
    @figure[title](type=label; pos=0,-1; anchor=sw; color=darkblue);
    @figure[rcvdPkText](type=indicatorText; pos=420,20; anchor=w; font=,20; textFormat="packets received: %g"; initialValue=0);
    @statistic[rcvdPk](source=hostB_rcvdPk; record=figure(count); targetFigure=rcvdPkText);
    @signal[hostB_rcvdPk];
    @delegatesignal[rcvdPk](source=hostB.udpApp[0].rcvdPk; target=hostB_rcvdPk);
submodules:
    visualizer: IntegratedCanvasVisualizer {
        @display("p=580,125");
    }
    configurator: IPv4NetworkConfigurator {
        @display("p=580,200");
    }
    radioMedium: <mediumType> like IRadioMedium {
        @display("p=580,275");
    }
    figureHelper: DelegateSignalConfigurator {
        @display("p=580,350");
    }
    hostA: <hostType> like INetworkNode {
        @display("p=50,325");
    }
    hostB: <hostType> like INetworkNode {
        @display("p=450,325");
    }

}

1
Post your code.user7627726

1 Answers

2
votes

First of all go to INET properties | OMNeT++ | Makemake | select src | Options... | Compile tab | More >> and ensure that you have set "Export include path for other projects" and "Force compiling object files for use in DLLs". And in Target tab set "Export this shared/static library for other projects". Then rebuild INET.

If it doesn't help, then try the following workaround:

  1. In properties of your project (e.g. WireTryLiveson):
    • select inet in Project References
    • go to OMNeT++ | Makemake | select src | Options... | Target and select "Shared library (.dll, .so or .dylib)"
    • go to OMNeT++ | Makemake | select src | Options... | Compile and select "Add include paths exported from referenced projects"
  2. In Run | Run Configurations... of your project select opp_run and ensure that Working dir actually indicates the directory which contains omnetpp.ini.