在 NS-3 (C++) 中创建对象数组时出错
Error while creating array of objects in NS-3 (C++)
在 NS-3 .cc
文件中,我试图创建 UdpEchoClientHelper
class 的实例化数组,只需执行以下操作:
UdpEchoClientHelper echoClient[NO_OF_NODES];
当我尝试构建时收到错误消息:
../scratch/test.cc:55:33: error: no matching function for call to ‘ns3::UdpEchoClientHelper::UdpEchoClientHelper()’
我在数组声明时做错了吗?
UdpEchoClientHelper::UdpEchoClientHelper()
这些是可用的构造函数:
/**
* Create UdpEchoClientHelper which will make life easier for people trying
* to set up simulations with echos.
*
* \param ip The IP address of the remote udp echo server
* \param port The port number of the remote udp echo server
*/
UdpEchoClientHelper (Address ip, uint16_t port);
/**
* Create UdpEchoClientHelper which will make life easier for people trying
* to set up simulations with echos.
*
* \param ip The IPv4 address of the remote udp echo server
* \param port The port number of the remote udp echo server
*/
UdpEchoClientHelper (Ipv4Address ip, uint16_t port);
/**
* Create UdpEchoClientHelper which will make life easier for people trying
* to set up simulations with echos.
*
* \param ip The IPv6 address of the remote udp echo server
* \param port The port number of the remote udp echo server
*/
UdpEchoClientHelper (Ipv6Address ip, uint16_t port);
你应该先看看教程。