  A mapping between stationary solutions of nonlinear Sch\"odinger equations
with real and complex potentials is constructed and a set of exact solutions
with real energies are obtained for a large class of complex potentials. As
specific examples we consider the case of the damped dynamics of a quantum
harmonic oscillator and the case of dissipative periodic soliton solutions of
the nonlinear Schr\"odinger equation with complex potential.
