An existing two-dimensional method for the prediction of steady-state incompressible flows in complex geometry is extended to treat also compressible flows at all speeds. The primary variables are the Cartesian velocity components, pressure and temperature. Density is linked to pressure via an equation of state. The influence of pressure on density in the case of compressible flows is implicitly incorporated into the extended SIMPLE algorithm, which in the limit of incompressible flow reduces to its well-known form. Special attention is paid to the numerical treatment of boundary conditions. The method is verified on a number of test cases (inviscid and viscous flows), and both the results and convergence properties compare favourably with other numerical results available in the literature.