Abstract The p t-differential inclusive production cross sections of the prompt charmed mesons D0, D+, and D*+ in the rapidity range |y| < 0.5 were measured in proton-proton collisions at $ \sqrt {s} = 7{ }TeV $ at the LHC using the ALICE detector. Reconstructing the decays D0 → K−π+, D+ → K−π+π+, D*+ → D0π+, and their charge conjugates, about 8,400 D0, 2,900 D+, and 2,600 D*+ mesons with 1 < p t < 24 GeV/c were counted, after selection cuts, in a data sample of 3.14 × 108 events collected with a minimum-bias trigger (integrated luminosity L int = 5 nb−1). The results are described within uncertainties by predictions based on perturbative QCD.