Special treatment is required for ro-vibrational calculations involving polyatomic molecules of linear geometry in order to avoid singularities in the kinetic energy operator. Here we present a variational approach which allows calculations involving such configurations, with a set of 3N-5 linearized coordinates used to represent the vibrations. This approach has been implemented as part of the variational nuclear motion program TROVE (Theoretical ROVibrational Energies). A symmetry adapted basis set based on the Dnh symmetry point group is used. As an illustration of the 3N-5 model presented, TROVE has been used to compute an ab initio room temperature line list for C212H2 using symmetry-adapted ab initio potential energy (CCSD(T)-F12c/cc-pVQZ-F12) and dipole moment surfaces for the ground electronic state. Line positions and intensities (J ≤ 58, l < 8, covering the wavenumbers up to 10 000 cm-1) are compared against HITRAN-2016 and ASD-1000. Alternative methods for treating linear molecules and future work are discussed.