OMNeT ++模拟引用INET的项目:'无法加载库libINET.dll'

时间:2017-07-24 00:27:30

标签: dll omnet++ inet

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

  1. 打开“RSVPPacket.msg”,修改它然后将其更改并保存(当我搜索“libinet.dll”时谷歌小组建议)
  2. 构建INET
  3. 似乎都没有用。 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");
        }
    

    }

1 个答案:

答案 0 :(得分:2)

首先转到INET属性| OMNeT++ | Makemake |选择src | Options... | Compile标签| More >>并确保您已为其他项目设置&#34;导出包含路径&#34;和&#34;强制编译目标文件以在DLL中使用&#34;。并在Target选项卡集&#34;为其他项目导出此共享/静态库&#34;。然后重建INET

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

  1. 在项目的属性中(例如WireTryLiveson):
    • inet
    • 中选择Project References
    • 转到OMNeT++ | Makemake |选择src | Options... | Target并选择&#34;共享库(.dll,.so或.dylib)&#34;
    • 转到OMNeT++ | Makemake |选择src | Options... | Compile并选择&#34;添加从引用项目导出的包含路径&#34;
  2. Run |中项目的Run Configurations...选择opp_run并确保Working dir实际指示包含omnetpp.ini的目录。