0

I have a static library compiled with gcc 7.1 and I'm wondering if I can link it to a process compiled with gcc 11.1 c++20.

I have a c++ library compiled with gcc 7.1 c++17 and I'm wondering if I can link it to a process compiled with gcc 11.1 c++20.

Peter
  • 109
  • 7
  • 1
    Did you try it? Shouldn't the linker complain if it is not binary compatible? static or dynamic linking? – mch Apr 07 '23 at 08:11
  • Try it. If it fails, search the web for the error messages. If that doesn't work, extract a [mcve]. If you still can't find an answer, ask here. Asking a yes/no question about something which you could easily answer yourself isn't good. – Ulrich Eckhardt Apr 07 '23 at 08:22
  • 2
    It can compile and work but it may generate a disaster !! – Peter Apr 07 '23 at 08:29
  • 1
    AFAIK there are no ABI compatibility guarantees. Recompile the library with the new compiler. – Jesper Juhl Apr 07 '23 at 09:58
  • 2
    Code librarian Titus Winters would say "compile everything — ABSOLUTELY EVERYTHING — with the same flags, at the same time, with the same compiler, or fear the wrath of the ODR gods." – Eljay Apr 07 '23 at 13:43

0 Answers0