Shadows disappear after building the lighting

So I’m attempting to cast dynamic shadows that look something like this:

I want the shadow to be generated by the cube. For some reason after I build the lighting, it looks like this:

The light is stationary and the shadow seems to disappear after I build the lighting. The shadow works if the light is movable but not if it’s stationary. I don’t really want to make my lights movable because I feel it would affect the performance. So is there a way to make shadows like the first picture without having to make my lights movable?