0

can we use a library built with a different flag say -std=c++17 with my program which is going to be built using -std=c++11 in these cases.

A) Same compiler used to build the library:
case 1: shared lib (.so)
case 2: static library (.a)

B) Different compiler:
case 1: shared lib (.so)
case 2: static library (.a)
Kumar Roshan Mehta
  • 3,078
  • 2
  • 27
  • 50
  • 4
    Depends on the compiler. Some compilers maintain ABI compatibility (what you'd need) between some standards versions. You'd need to consult the docs for your particular compiler – Justin Mar 21 '18 at 16:13
  • What particular thing I should look in compiler docs. I mean the keywords to search for. – Kumar Roshan Mehta Mar 21 '18 at 16:29
  • Starting point (may be out of date) https://stackoverflow.com/questions/16190269/g-always-backward-compatible-with-older-static-libraries – Richard Critten Mar 21 '18 at 18:39

0 Answers0