I'm sorry my English is poor.
I have recently bumped into this.
I have a static library (let's say jsoncpp) compiled on CentOS 7 on x86_64 CPU. And I want to use libjsoncpp.a on Ubuntu 18 04 on x86_64 CPU.
My colleague said it's only related to CPU. But when compiled with the static library, these error message popped up:
Compilation fails with “relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object”
...
and sometimes it's like "this is the wrong PIE object, recompile this with -fPIE".
What I want to know is what factors are in play when using static library compiled on platform A with program compiled on platform B.
Are those factors glibc version and CPU architecture only?
I would appreciate if anyone could point me at some direction.