It is an overstatement to say that object files and libraries compiled by the 4.2 compiler cannot be linked with object files and libraries compiled by the 5.0 compiler. The statement is true whenever the files and libraries present a C++ interface.
Sometimes a library is coded in C++ for convenience, yet presents only a C interface to the outside world. Put simply, having a C interface means that a client cannot tell the program was written in C++. More specifically, having a C interface means that all of the following are true:
All externally-called functions have C linkage and use only C types for parameters and returned value.
All pointers-to-function in the interface have C linkage and use only C types for parameters and returned value.
All externally-visible types are C types.
All externally-available objects have C types.
No C++ exceptions escape from or are passed into the library.
Use of cin, cout, cerr, or clog is not permitted.
If a library meets the C-interface criteria, it can be used where ever a C library can be used. In particular, such libraries can be compiled with one version of the C++ compiler and linked with object files compiled with a different version.
However, if any of these conditions are violated, the files and libraries cannot be linked together. If an attempted link succeeds, which is doubtful, the program does not run correctly.