public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: 孙世龙 <sunshilong369@gmail.com>
Cc: gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: Linking to dynamic libraries compiled by old version g++
Date: Mon, 7 Nov 2022 13:02:04 +0000	[thread overview]
Message-ID: <CAH6eHdS-q5m-83Kt8k6GAaFUcLqn+RbMbVR9CCpepST8+xZ6nA@mail.gmail.com> (raw)
In-Reply-To: <CAAvDm6YXKxdxApX8p3gzB5moKNqrnmcxk4=ZXDRHdw6UZFLdOA@mail.gmail.com>

On Mon, 7 Nov 2022 at 02:11, 孙世龙 via Gcc-help <gcc-help@gcc.gnu.org> wrote:
>
> There are dynamic libraries provided by others, which are out of my control.
>
> What I know is that most of the aforementioned libraries are compiled
> by g++4.9.4 & g++4.8.4 with C++11 support, and some libraries are
> compiled by g++11.1.0 with C++14 support.
>
> And I have to use newer g++ which supports C++17 to compile my
> project. I intend to use g++11.3.0 on Ubuntu20.4.
>
> Is there any potential problem I should be aware of when linking to
> dynamic libraries compiled by the said old version g++ ?

Yes, this is not supported.

C++11 support in GCC 4.8 and 4.9 was experimental and unstable, and is
not ABI compatible with C++11 code compiled by GCC 5 or later.

Specifically, there were changes to std::chrono::system_clock, and
std::error_category, and std::condition_variable. If those types are
used in the old dynamic libraries, particularly across the library API
boundary, then you are likely to run into problems. There are probably
other incompatibilities that I'm forgetting. I don't bother to
remember all the incompatibilities, because what you're trying to do
is not supported and so I don't spend any effort memorising all the
ways it can fail.

  reply	other threads:[~2022-11-07 13:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-07  2:10 孙世龙
2022-11-07 13:02 ` Jonathan Wakely [this message]
2022-11-08  3:03   ` 孙世龙

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAH6eHdS-q5m-83Kt8k6GAaFUcLqn+RbMbVR9CCpepST8+xZ6nA@mail.gmail.com \
    --to=jwakely.gcc@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=sunshilong369@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).