Getting error as unexpected identifier and error in class specification

In reply to dileep254:

Compiling files individually won’t work, as SystemVerilog considers each file a unique scope.

Please see https://blogs.sw.siemens.com/verificationhorizons/2010/07/13/package-import-versus-include/