ns3中在使用.waf --run xxx时候出现
assert failed. cond="uid != 0", msg="Assert in TypeId::LookupByName: sender not found", file=../src/core/model/type-id.cc, line=828
terminate called without an active exception
前提:
使用了自定义的模块(即#include了自己写的.cc和.h文件)
在将在run的.cc文件中使用了模板Ptr<xxx>时写了
Config::Connect("....../sender/......") // ←就是因为这里没注意大小写打错了
在自己写的.cc文件中能看到GetTypeId(),这里我的是
可以看到GetTypeId()前的类是Sender,参考这篇文章 插入一句NS_OBJECT_ENSURE_REGISTERED("Sender");
并且在将要运行的.cc中将sender改为Sender,解决