Re: (git HEAD) gcc 7 build with C++17: fatal error: charconv: No such file or directory (Issue #23484)

1,065 views
Skip to first unread message

jolz

unread,
Apr 24, 2023, 6:41:44 AM4/24/23
to wx-...@googlegroups.com, Subscribed

seems, like the compiler detection may be altered a bit for not-yet-ready compilers: https://github.com/wxWidgets/wxWidgets/blob/master/src/common/string.cpp#L1561


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23484/1519884225@github.com>

jolz

unread,
Apr 24, 2023, 6:46:06 AM4/24/23
to wx-...@googlegroups.com, Subscribed

this is my test compile:

git clone --recurse-submodules https://github.com/wxWidgets/wxWidgets
cd wxWidgets

# then compile with gcc 7
cmake -DwxBUILD_CXX_STANDARD=17 -DwxUSE_GUI=0 .. && cmake --build .

# if you currently do not have a gcc-7, you can use an image
podman run -it -v $PWD:$PWD -w$PWD --userns=keep-id conanio/gcc7 sh -c 'rm -rf xx1 ; mkdir xx1 ; cd xx1 && cmake -DwxBUILD_CXX_STANDARD=17 -DwxUSE_GUI=0 .. && cmake --build .'

Description

string.cpp does not compile:

[ 61%] Building CXX object libs/base/CMakeFiles/wxbase.dir/__/__/__/src/common/string.cpp.o
/icpers/hl/work/tecs/hellowx/wxWidgets-master/src/common/string.cpp:1571:10: fatal error: charconv: No such file or directory
 #include <charconv>
          ^~~~~~~~~~
compilation terminated.
libs/base/CMakeFiles/wxbase.dir/build.make:950: recipe for target 'libs/base/CMakeFiles/wxbase.dir/__/__/__/src/common/string.cpp.o' failed

the issue sounds like https://stackoverflow.com/questions/49639808/fatal-error-charconv-file-not-found-in-clang-6-0-with-std-c17

  • the problem is solved on newer gcc versions (image conanio/gcc8 works)

Platform and version information

  • wxWidgets version master
  • wxWidgets port gtk3 (base on linux)
  • OS opensuse leap 15.4
  • Compiler gcc 7.5.0


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23484@github.com>

VZ

unread,
Apr 24, 2023, 6:48:41 AM4/24/23
to wx-...@googlegroups.com, Subscribed

I hoped we could avoid configure checks for C++17 compilers, but apparently no such luck :-(

Maybe we could use __has_include however, as any C++17 compiler is supposed to have it?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23484/1519893250@github.com>

jolz

unread,
Apr 24, 2023, 9:13:10 AM4/24/23
to wx-...@googlegroups.com, Subscribed

created (trivial) pull request as @vadz proposed #23487
Sorry, I have only tried this with with linux, some gcc/clang versions.

# clang 5
podman run -it -v $PWD:$PWD -w$PWD --user $(id -u):$(id -g) --userns=keep-id conanio/clang50 sh -c 'mkdir -p xx1 ; cd xx1 && cmake -DwxBUILD_CXX_STANDARD=17 -DwxUSE_GUI=0 .. && cmake --build . -j$(nproc)'

# gcc 7
podman run -it -v $PWD:$PWD -w$PWD --user $(id -u):$(id -g) --userns=keep-id conanio/gcc7 sh -c 'mkdir -p xx1 ; cd xx1 && cmake -DwxBUILD_CXX_STANDARD=17 -DwxUSE_GUI=0 .. && cmake --build . -j$(nproc)'

# if you have docker (instead of podman) installed: 
docker run -it -v $PWD:$PWD -w$PWD --user $(id -u):$(id -g)  conanio/gcc7 sh -c 'mkdir -p xx1 ; cd xx1 && cmake -DwxBUILD_CXX_STANDARD=17 -DwxUSE_GUI=0 .. && cmake --build . -j$(nproc)'


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23484/1520137501@github.com>

VZ

unread,
Apr 28, 2023, 10:44:27 AM4/28/23
to wx-...@googlegroups.com, Subscribed

Closed #23484 as completed via 160b4dd.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issue/23484/issue_event/9125645722@github.com>

Reply all
Reply to author
Forward
0 new messages