From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by sourceware.org (Postfix) with ESMTPS id 0D6C43858C00 for ; Mon, 7 Nov 2022 13:02:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0D6C43858C00 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-x536.google.com with SMTP id s12so7816992edd.5 for ; Mon, 07 Nov 2022 05:02:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=h4YCmx8rbrFDiRRBXAsriF/kDUQsqb9+DWi84ourqRY=; b=K3TsfBsUdnTsuK5J0vGG9yk6fn5BseYjY/A9oHQwSeBKX+uCEuWCdSTBO5b+xlJC/3 sKP+PmQtTrsN96e6McUJuCEu76bit5BM+K2TpbbtHYmK8CBCsC7aQVD/s5zI4FPxKqLn R80cAypA+77c+bPt2VBoI6edThx5AycuTwPPHRkZ+iw0BaPan/NYjNq3y5JSqA5IwnnV LjHLNvOpIIJUJcVPHmnSI/vYxZ2khcxc2goWSIsfJXtkPif3qFYOXzjrBSwg7GMW0bgK GBXVB+QvhJljgdGsP2l26MY+jZPsNleS1ycmMaVQT4e/inANAbhhu6F3DZZrPypkhepo JI+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h4YCmx8rbrFDiRRBXAsriF/kDUQsqb9+DWi84ourqRY=; b=EZfM2zCRv1Qx1jb1Dmyv0InUCkGmiwjgfNBhSKKju/vbAO2kkH/ogs62G753Prl82k dpGd4wHwwCmnoqbMLl2fNXNtAVTXiKFMJ4nSoHOF4JT6dq6kqlkAHFyfCqnIIeX/PuIA Wm/uayO9SsB9Jv9d6TmwxPkhsmIrFT9RAe0Ge1/uU7wVTIoMQdVX23LyAhvD3otoOruP nElkGuMkk+LlRX9y42kd9+hrPRUjBtVDcdY0aLFMYyD2tNDJ2g1x16YOl6wWcm0p77hM c5jwVLwaR5gIismfposV3hwBosb33xh6Gc8MIr8xllbWAzt70gOgjvGdxgpZzEd/3Ufr enrQ== X-Gm-Message-State: ACrzQf2a2JNkTdJJJv/F4dAhKbQ+5NcpCxETzYA6vOlCVbHdp03efxbh bdnxqIwt69O3eyaz2ifl1rzJDxJXFzplfSXu4Ak= X-Google-Smtp-Source: AMsMyM6C77a37C+6R/NrLTNE+88G16SQkWqfjpupRoHWvZ2grpdMjoasjdwIyBQF41fhlVYVRNHYJaB1in6eQvV8D88= X-Received: by 2002:aa7:dad9:0:b0:462:e628:185b with SMTP id x25-20020aa7dad9000000b00462e628185bmr50656118eds.33.1667826135689; Mon, 07 Nov 2022 05:02:15 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Mon, 7 Nov 2022 13:02:04 +0000 Message-ID: Subject: Re: Linking to dynamic libraries compiled by old version g++ To: =?UTF-8?B?5a2Z5LiW6b6Z?= Cc: gcc-help Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, 7 Nov 2022 at 02:11, =E5=AD=99=E4=B8=96=E9=BE=99 via Gcc-help wrote: > > There are dynamic libraries provided by others, which are out of my contr= ol. > > 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.