A general theory is given for quantizing both constrained and unconstrained systems with second-order Lagrangian, using the WKB approximation. In constrained systems, the constraints become conditions on the wave function to be satisfied in the semiclassical limit. This is illustrated with two examples.