OMNeT++ 模拟引用 INET 的项目:'cannot load library libINET.dll'

OMNeT++ Simulating a project that references INET: 'cannot load library libINET.dll'

我正在尝试构建和模拟一个引用 INET 的项目(实际上是 INETWirelessTutorial),但是我收到下面的错误消息“错误:无法加载库'../inet/src//libINET.dll': 动态 link 库 (DLL) 初始化例程失败”。我的项目 WireTryLiveson 引用了项目 INET。我想知道我是否需要 link 不同的路径环境变量?我尝试了以下方法:

  1. 打开"RSVPPacket.msg",修改后改回来,保存(我搜索"libinet.dll"时google群建议的)
  2. 构建 INET

似乎都不起作用。 INET 示例项目模拟得很好。

我应该更改什么才能加载 libINET.dll?

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

Here are my environment variables.

这是 OMNET++ 控制台显示的错误信息:

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

这是我的 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

这是我的文件 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");
    }

}

首先转到 INET 属性 | OMNeT++ | Makemake | select src | Options... | Compile 选项卡 | More >> 并确保您已设置 "Export include path for other projects" 和 "Force compiling object files for use in DLLs"。并在 Target 选项卡中设置 "Export this shared/static library for other projects"。然后重建 INET.

如果没有帮助,请尝试以下解决方法:

  1. 在项目的属性中(例如 WireTryLiveson):
    • select inetProject References
    • 转到OMNeT++ | Makemake | select src | Options... | Target 和 select "Shared library (.dll, .so or .dylib)"
    • 转到OMNeT++ | Makemake | select src | Options... | Compile 和 select "Add include paths exported from referenced projects"
  2. Run | Run Configurations... 您的项目 select opp_run 并确保 Working dir 实际上指示包含 omnetpp.ini.
  3. 的目录