What is the meaning of [he that would have eggs must endure the cackling of hens]

You must be prepared to put up with something unpleasant or annoying in order to get what you want; also used of an undesirable aspect or drawback that accompanies something.