Definition of new() is missing in your Packet class.
Add the following:
function new(string name = “Packet”);
super.new(name);
endfunction : new
and also you need to remove “pkt=new();” in function A();
Definition of new() is missing in your Packet class.
Add the following:
function new(string name = “Packet”);
super.new(name);
endfunction : new
and also you need to remove “pkt=new();” in function A();