The QCD axion solving the strong CP problem may originate from antisymmetric tensor gauge fields in compactified string theory, with a decay constant around the GUT scale. Such possibility appears to be ruled out now by the detection of tensor modes by BICEP2 and the PLANCK constraints on isocurvature density perturbations. A more interesting and still viable possibility is that the string theoretic QCD axion is charged under an anomalous U(1)A gauge symmetry. In such case, the axion decay constant can be much lower than the GUT scale if moduli are stabilized near the point of vanishing Fayet-Illiopoulos term, and U(1)A-charged matter fields get a vacuum value v ∼ (mSUSYMnPl)1/(n+1) (n ≥ 0) induced by a tachyonic SUSY breaking mass mSUSY. We examine the symmetry breaking pattern of such models during the inflationary epoch with HI ≃ 1014 GeV, and identify the range of the QCD axion decay constant, as well as the corresponding relic axion abundance, consistent with known cosmological constraints. In addition to the case that the PQ symmetry is restored during inflation, i.e. v(tI ) = 0, there are other viable scenarios, including that the PQ symmetry is broken during inflation with v(tI ) ∼ (4HIMnPl)1/(n+1) ∼ 1016–1017 GeV due to the Hubble-induced D-term DA ∼ 82H2 I , while v(t0) ∼ (mSUSYMnPl)1/(n+1) ∼ 109–5×1013 GeV in the present universe, where v(t0) above 1012 GeV requires a fine-tuning of the axion misalignment angle. We also discuss the implications of our results for the size of SUSY breaking soft masses.