As the only way String theory can respect the principles of quantum mechanics and Special theory of relativity, by formulating it in hypothetical nine dimensional space. You could use string compactification for d number of non compact direction, all it requires to have d non compact direction is to choose an appropriate compact space of dimension (9-d).
The question arises here, Then Why our Universe is in Three dimensional space?