0

When attempting to run a shared library I've built I am hitting the error when trying to load the shared library (within Linux) undefined symbol: _ZSt10from_charsPKcS0_ReSt12chars_format. Performing nm --unmangle shows that the lines that are causing an issue are:

U std::from_chars(char const*, char const*, double&, std::chars_format)
U std::from_chars(char const*, char const*, long double&, std::chars_format)
U std::from_chars(char const*, char const*, float&, std::chars_format)

After trying to figure this out, as it is quite weird coming from the standard library, is that it is a known and common issue. Some similar threads are:

Looking at: https://en.cppreference.com/w/cpp/compiler_support also confirms this with the line relating to this problem being: P2291R3.

I think this is coming from the libpqxx library I have included as it is not in any of my code therefore, my question:

Is there any method out there to deal with this?

Could I create a definition for this just to overload it? Are this going to be implemented soon? Or do I have to only change the libpqxx library? At least the version.

  • Linux: Ubuntu 20.04
  • Compiler: G++-10

Update

From one of the comments below pointed out that:

  1. Was not looking at the wrong list
  2. Upgrading to the most up to date g++11 solved this issue
Adriano
  • 80
  • 11
  • `attempting to run a shared library` what do you mean? Please post the command line use to compile your program and the ones that produce that error. – ichramm Aug 15 '22 at 14:50
  • Does "G++-10" support that feature of the C++ standard library? – Nicol Bolas Aug 15 '22 at 14:51
  • @ichramm I'm also using the `dylib` library to handle loading and it just uses the `open()` function from linux headers: `m_handle = open((final_path + final_name).c_str());` – Adriano Aug 15 '22 at 14:53
  • @NicolBolas Looking at the compiler support, no compiler support it but given this I dont know why it is in as an option? – Adriano Aug 15 '22 at 14:55
  • 1
    @Adriano: "*Looking at the compiler support, no compiler support it*" [That's untrue.](https://en.cppreference.com/w/cpp/compiler_support/17) Clang 's Libc++ doesn't but more recent versions of VS and GCC do. – Nicol Bolas Aug 15 '22 at 14:59
  • @NicolBolas Hmmm seems like I was looking at the wrong list. Looks like I also have to update to G++11 in order for this to work as G++8 does not have the FP support – Adriano Aug 15 '22 at 15:02
  • Probably your build process is wrong. Invoking `gcc` is not same thing as invoking `g++`. The first one do not link C++ standard library implicitly - when this happens it explains your error. So please provide description of your build process. – Marek R Aug 15 '22 at 15:26
  • Lack of `P2291R3` will lead to compile time issue not linking issue. – Marek R Aug 15 '22 at 15:31
  • Im running an example just fine on compiler explorer: https://godbolt.org/z/c9Y3fh83P – Something Something Aug 15 '22 at 15:43

0 Answers0