Feedback stabilization of magnetohydrodynamic (MHD) modes in a tokamak is studied in a cylindrical model with a resistive wall, plasma resistivity, viscosity, and toroidal rotation. The control is based on a linear combination of the normal and tangential components of the magnetic field just inside the resistive wall. The feedback includes complex gain, for both the normal and for the tangential components, and it is known that the imaginary part of the feedback for the former is equivalent to plasma rotation [J. M. Finn and L. Chacon, Phys. Plasmas 11, 1866 (2004)]. The work includes (1) analysis with a reduced resistive MHD model for a tokamak with finite b and with stepfunction current density and pressure profiles, and (2) computations with a full compressible visco-resistive MHD model with smooth decreasing profiles of current density and pressure. The equilibria are stable for b ¼ 0 and the marginal stability values b rp,rw < b rp,iw < b ip,rw < b ip,iw (resistive plasma, resistive wall; resistive plasma, ideal wall; ideal plasma, resistive wall; and ideal plasma, ideal wall) are computed for both models. The main results are: (a) imaginary gain with normal sensors or plasma rotation stabilizes below b rp,iw because rotation suppresses the diffusion of flux from the plasma out through the wall and, more surprisingly, (b) rotation or imaginary gain with normal sensors destabilizes above b rp,iw because it prevents the feedback flux from entering the plasma through the resistive wall to form a virtual wall. A method of using complex gain G i to optimize in the presence of rotation in this regime with b > b rp,iw is presented. The effect of imaginary gain with tangential sensors is more complicated but essentially destabilizes above and below b rp,iw . V C 2014 AIP Publishing LLC. [http://dx.