-1

在一个 NS-3.cc文件中,我试图创建一个UdpEchoClientHelper类的实例化数组,只需执行以下操作:

UdpEchoClientHelper echoClient[NO_OF_NODES];

当我尝试构建时,我收到错误消息:

../scratch/test.cc:55:33: error: no matching function for call to ‘ns3::UdpEchoClientHelper::UdpEchoClientHelper()’

我在数组声明中做错了吗?

4

1 回答 1

1

There's no matching constructor for

UdpEchoClientHelper::UdpEchoClientHelper()

These are the available constructors:

   /**
   * 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);

You should take a look to the tutorials first.

于 2015-03-10T14:54:25.143 回答