代码之家  ›  专栏  ›  技术社区  ›  user3395974

我无法在Windows 7中使用omnet++运行模拟程序

  •  0
  • user3395974  · 技术社区  · 8 年前

        package helloworld.simulations;
    
        import inet.networklayer.configurator.ipv4.FlatNetworkConfigurator;
        import inet.node.inet.Router;
        import inet.node.inet.StandardHost;
    
        @license(LGPL);
        network Network
        {
            @display("bgb=519,314");
            submodules:
                Client: StandardHost {
                    @display("p=82,217");
                }
                router: Router {
                    @display("p=218,117");
                }
                Server: StandardHost {
                    @display("p=361,198");
                }
                flatNetworkConfigurator: FlatNetworkConfigurator {
                    @display("p=296,46;b=45,44");
                }
            connections:
                Client.ethg++ <--> router.ethg++;
                router.ethg++ <--> Server.ethg++;
        }
    

    以及omnetpp中的代码。ini如下所示:

        [General]
        network = helloworld.simulations.Network
    
        **.Client.numTcpApps = 1
        **.Client.tcpApp[0].typename = "TCPBasicClientApp"
        **.Client.tcpApp[0].connectAddress = "Server"
        **.Client.tcpApp[0].connectPort = 80
        **.Client.tcpApp[0].thinkTime = 0s
        **.Client.tcpApp[0].idleInterval = 0s
    
        **.Server.numTcpApps = 1
        **.Server.tcpApp[0].typename = "TCPEchoApp"
        **.Server.tcpApp[0].localPort = 80
    
        **.ppp[*].queueType = "DropTailQueue"
        **.ppp[*].queue.frameCapacity = 10
    

    enter image description here

    现在,我不知道该如何解决这个问题。谢谢你的帮助!

    1 回复  |  直到 8 年前
        1
  •  1
  •   Jerzy D.    8 年前

    你建造了吗 INET ? 如果是,请转到 mingw

    opp_run -h nedfunctions -l /d/omnetpp-5.1.1/Projects/inet/src/inet | grep firstAvailableOrEmpty
    

    在-l之后,有一条通往你的 libINET.dll file . 您应该看到如下内容:

    FirstAvailableRempty:string FirstAvailableRempty(…)
    接受任意数量的字符串,将其解释为NED类型名称(限定或非限定),并返回存在的第一个字符串 它的C++实现类也可用。返回空字符串

    此外 FlatNetworkConfigurator 被称为 configurator flatNetworkConfigurator

    编辑
    INET OMNeT++ | Makemake |选择 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. 在里面 Properties | Project References 确保 inet 已选中。
    2. 属性 OMNeT++ | |选择包含源文件的目录| |
      • Add include paths exported from referenced projects
      • Add include dir and other compile options from enabled project features
    3. | | |选择包含源文件的目录| 选项。。。 | Link

      • Link with libraries exported from referenced projects
      • Add libraries and other linker options from enabled project features
    4. 重建项目。