2

Supposing that I have two libraries:

  • Lib1.a compiled with gcc 11 -std=c++2a

  • Lib2.a compiled with gcc 10 -std=c++17

I want to compile a binary that uses the two libraries but using gcc 11 -std=c++2a

I need to use boost also but I do not recognize the used standard version.

A C library is also needed. (I do not know the compiler version)

Is it possible/safe?

Saad Rami
  • 81
  • 6
  • 3
    It's safe. They all conform to the operating system's ABI, that's all that matters. – Barmar Oct 01 '21 at 18:34
  • Maybe take a look at boost compatibility info: https://www.boost.org/doc/libs/1_61_0/libs/log/doc/html/log/installation.html – Ilian Zapryanov Oct 01 '21 at 19:18
  • What stops you from trying? You need to test your application anyway, don't you? – the busybee Oct 01 '21 at 20:12
  • 1
    @Barmar The C++ standard libraries also matter, especially if standard-type objects are used in API functions of both libraries. See https://stackoverflow.com/questions/46746878/is-it-safe-to-link-c17-c14-and-c11-objects , though it doesn't list a stable version for C++20. – aschepler Oct 01 '21 at 20:13

0 Answers0