Error by compilation in one bit counter

Compile of env.sv failed with 1 errors.
click =>
** Error: scoreboard.sv(13): Typedef ‘scoreboard1’ multiply defined.
** Error: scoreboard.sv(13): Typedef ‘scoreboard1’ multiply defined.
** Error: stimulus.sv(11): Typedef ‘stimulus’ multiply defined.

code

class stimulus;
rand bit value;
constraint distribution {value dist { 0 := 1 , 1 := 1 }; }
endclass

class scoreboard1;
//stimulus sti;
bit [0:3] store;

/*task exp(stimulus sti);

 sti = new();
 store = store + sti.value;// Cal exp value and store in Scoreboard

endtask*/

endclass

always problem in
stimulus & scorboard class

whenever i make verification environment ,always got this problem so plz guide me to make far away to such kind of mistake.
plz check and discuused
thanks to all.

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](http://go.mentor.com/package-import-versus-include) for the difference between import and include.

In reply to dave_59:

actully i am in learnning period.
you can go this website

http://www.testbench.in/TS_23_ONES_COUNTER_EXAMPLE.html

plz help me

where can put package guide me.

In reply to Nishant Kumar:

my package file

package s;
`include"stimulus.sv"
endpackage:s

package m;
`include"monitor.sv"
endpackage:m

package s;
`include"scoreboard1.sv"
endpackage:s

package d;
`include"driver.sv"
endpackage:d

and wher i need that `include
import package like

package R;
import s::stimulus;

endpackage : R

package w;
import s::scoreboard;
endpackage : w

package x;
import d::driver;

endpackage : x

package y;
import m::monitor;
endpackage : y

according to need in environment file
imported package
similar importing done in whereever neede that particular class

error are like

Error: C:\modeltech_6.5\examples\scoreboard.sv(14): Could not find the package (s).

  • Error: C:\modeltech_6.5\examples\test_2.sv(14): Could not find the package (e).
    – Compiling program testcase
    ** Error: C:\modeltech_6.5\examples\test_2.sv(41): ‘environment’ is an unknown type.
    Or did you omit the ‘()’ for an instantiation?
    ** Error: C:\modeltech_6.5\examples\test_2.sv(46): ‘env’ is not a variable
    ** Error: C:\modeltech_6.5\examples\test_2.sv(46): Illegal LHS of assignment.
    ** Error: C:\modeltech_6.5\examples\test_2.sv(46): Illegal LHS of ‘new’ assignment.
    ** Error: C:\modeltech_6.5\examples\test_2.sv(46): ‘new’ must be used to assign to a class or covergroup handle.
    ** Error: C:\modeltech_6.5\examples\test_2.sv(46): Inappropriate use of ‘new’
    ** Error: C:\modeltech_6.5\examples\test_2.sv(53): Internal error: …/…/…/src/vlog/vresolve.c(412)

Could not find the package (s)

plz help me