We present here exact results for a one-dimensional gas, or fluid, of hard-sphere particles with attractive boundaries. The particles, which can exchange with a bulk reservoir, mediate an interaction between the boundaries. A two-dimensional lattice of such one-dimensional gas `columns' represents a discrete approximation of a three-dimensional gas of particles between two surfaces. The effective particle-mediated interaction potential of the boundaries, or surfaces, is calculated from the grand-canonical partition function of the one-dimensional gas of particles, which is an extension of the well-studied Tonks gas. The effective interaction potential exhibits two minima. The first minimum at boundary contact reflects depletion interactions, while the second minimum at separations close to the particle diameter results from a single adsorbed particle that crosslinks the two boundaries. The second minimum is the global minimum for sufficiently large binding energies of the particles. Interestingly, the effective adhesion energy corresponding to this minimum is maximal at intermediate concentrations of the particles.