How to get type name on systemVerilog

module top_tb ; 
  import "DPI-C" context task get_if_name(string scope);
  
  initial begin 
    get_if_name ( "top_tb.master_interface") ; 
    get_if_name ( "top_tb.slave_interface") ; 
  end 
endmodule

When I try this, i have thios fatal error :
Null foreign function pointer encountered when calling ‘get_if_name’__

what is the solution in this case ?
Thanks in adavance