My application links statically against several libraries such as libpng, zlib, jpeglib, freetype, etc. I do not use any IDE or build tool such as CMake but just makefiles. I'm using gcc on Linux, Android, and Mac OS and Visual C on Windows. My target architectures are x86, x86_64, powerpc, and arm. My application and the link libraries are pure C, no C++.
After installing a new version of gcc or Visual C, I typically recompile all those link libraries I statically link my application against with the new compiler version although I've always wondered whether this is really necessary.
That's why I'd like to put up this question: Do static link libraries have to be compiled with the same compiler version as my application or can they also be compiled with older compiler versions without causing any harm?