Most/all modern distributions can run programs built with lsbcc[1] from the Linux Standard Base workgroup. The lsbdev environment links your program against "stub" .so files that advertise appropriate symbol versions, and prevent referencing library symbols that are not defined in the standard.
It can be somewhat of a hassle to get programs to build in this environment, but it greatly reduces the chances of finding an incompatibility when the program is later run under an unexpected Linux distribution. LSB includes an app checker[2] which can generate reports[3] showing compatibility with various distributions.
[1] https://wiki.linuxfoundation.org/en/Book/HowToDevel
[2] http://ispras.linuxbase.org/index.php/About_Linux_Applicatio...
[3] http://ispras.linuxbase.org/index.php/File:LAC_TestReportDis...