Exact solutions for surface elevation profiles of idealised glaciers and ice sheets provide valuable insights into the geometry and flow of their real-world counterparts. These solutions are also useful in testing numerical glacier models. Here, we present an exact solution for the elevation profile of glaciers on erodible bedrock, assuming a steady competition between subglacial erosion and a uniform, time-independent rock uplift rate. The subglacial erosion rate is assumed to be proportional to the product of the local ice flux and the surface slope. Given a mass-balance profile that is linear in surface elevation and a Gaussian dependence of the glacier width on the surface elevation, the exact solution for the steady surface elevation profile has an inverse error-function form. This idealised solution provides insights into the steady-state shape and interannual variability of the mass balance of real-world glaciers.