The ester of the formula (I) is obtained by reacting an alcohol or its halide of the formula (II), ##STR5## wherein R1, X and Y are as defined above and A is a hydroxyl group or a halogen atom such as chlorine or bromine, with approximately equimolar amounts of a carboxylic acid of the formula (III) or (IV), ##STR6## wherein R3, R4, R5 and n are as defined above, or reactive derivative thereof opt