Omnet++ 我无法使用omnet++;在Windows7中
我正在学习omnet++来模拟网络。packeage.ned中的代码如下所示:Omnet++ 我无法使用omnet++;在Windows7中,omnet++,Omnet++,我正在学习omnet++来模拟网络。packeage.ned中的代码如下所示: package helloworld.simulations; import inet.networklayer.configurator.ipv4.FlatNetworkConfigurator; import inet.node.inet.Router; import inet.node.inet.StandardHost; @license(LGPL); ne
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++;
}
[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
但是,当我运行此程序时,我遇到以下问题:
现在,我不知道如何解决这个问题。谢谢你的帮助 您是否构建了
INET
?如果是,请转到mingw
控制台并键入:
opp_run -h nedfunctions -l /d/omnetpp-5.1.1/Projects/inet/src/inet | grep firstAvailableOrEmpty
在-l之后有一个指向libINET.dll文件的路径。您应该看到如下内容:
FirstAvailableRempty:字符串FirstAvailableRempty(…)
接受任意数量的字符串,将其解释为NED类型名称(限定或非限定),并返回存在的第一个字符串和
它的C++实现类也是可用的。返回空字符串
如果没有可用的类型
此外,FlatNetworkConfigurator
的实例必须被称为configurator
,而不是FlatNetworkConfigurator
编辑
转到INET
properties,然后选择OMNeT++
|Makemake
|选择src
|选项…
编译
选项卡
更多>并确保已为其他项目设置导出包含路径
和强制编译对象文件以在DLL中使用。并在Target
选项卡集合中为其他项目导出此共享/静态库
。然后重建INET
然后在您的项目中:
在属性
|项目引用
中,确保选择了inet
在Properties
|OMNeT++
|Makemake
|选择带有源文件的目录|选项…
|编译
,并确保选中以下选项:
添加从引用项目导出的包含路径
从已启用的项目功能中添加include dir和其他编译选项
在Properties
|OMNeT++
|Makemake
|选择带有源文件的目录|选项…
|链接
,并确保选中以下选项:
链接从引用项目导出的库
从已启用的项目功能中添加库和其他链接器选项
重建您的项目
谢谢你的帮助。对不起,我是初学者。我还有一个问题。我已经在mingw控制台中键入了字符串,并获得了以下结果:firstAvailableRempty:string firstAvailableRempty(…),那么,下一步怎么做?再次感谢你!您是如何创建示例的?作为新项目还是INET中的文件夹?我将示例创建为新项目。INET中没有文件夹。您使用哪个版本的INET?我已经扩展了我的答案,我希望它能帮助你。我再试了一次。但它仍然不起作用。INET的版本是3.6.1。OMNET++的版本是5.1.1。无论如何,非常感谢!