旧代码如下:
#ifdef WITH_IPv4
IRoutingTable *rt = RoutingTableAccess().getIfExists();
#endif
#ifdef WITH_IPv6
RoutingTable6 *rt6 = RoutingTable6Access().getIfExists();
#endif
我一直在尝试的新代码,但是在ipv6正常的情况下我仍然会遇到ipv4错误: 未在此范围内声明“ getRoutingTable”
#ifdef WITH_IPv4
Ipv4RoutingTable *rt = getRoutingTable().getIfExists();
#endif
#ifdef WITH_IPv6
Ipv6RoutingTable *rt6 = getRoutingTable().getIfExists();
#endif