The pT-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 √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<pT<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 Lint=5/nb). The results are described within uncertainties by predictions based on perturbative QCD.