We present a detailed abundance study based on spectroscopic data obtained with HARPS of two solar-analogue main targets for the asteroseismology programme of the CoRoT satellite: HD 42618 and HD 43587. The atmospheric parameters and chemical composition are accurately determined through a fully differential analysis with respect to the Sun observed with the same instrumental set-up. Several sources of systematic errors largely cancel out with this approach, which allows us to narrow down the 1-sigma error bars to typically 20 K in effective temperature, 0.04 dex in surface gravity, and less than 0.05 dex in the elemental abundances. Although HD 42618 fulfils many requirements for being classified as a solar twin, its slight deficiency in metals and its possibly younger age indicate that, strictly speaking, it does not belong to this class of objects. On the other hand, HD 43587 is slightly more massive and evolved. In addition, marked differences are found in the amount of lithium present in the photospheres of these two stars, which might reveal different mixing properties in their interiors. These results will put tight constraints on the forthcoming theoretical modelling of their solar-like oscillations and contribute to increase our knowledge of the fundamental parameters and internal structure of stars similar to our Sun.