Acoustoelastic guided wave is promising for prestress measurements in waveguides. However, most of the studies are limited to simple waveguides (e.g. plates and rods) with normal stress. In this paper, a method is developed by considering the acoustoelastic effect in the semi-analytical finite element (SAFE) model, and implemented into a commercial software package. It provides a generalized tool to study acoustoelastic guided waves in waveguides with any cross sections under arbitrary prestress conditions. The method is first validated in a plate under two different prestress conditions. Then it is applied to two practical cases, a rectangular bar subjected to a hydrostatic pressure and an aluminum plate under simple shear deformation, to demonstrate the capability of the method. For the first time, the effect of shear stress on guided wave propagation has been discussed.