This error is most likely because you are compiling the file multiple times, probably because you are `including the file multiple times. Please check you compilation log files for that.
Our recommended compilation strategy is to include your class files once into a package, and then import the package. See [this link](https://blogs.sw.siemens.com/verificationhorizons/2010/07/13/package-import-versus-include/) for the difference between import and include.