CXX20 ? Cannot compile on older systems.

MMEX4Desktop, incl. Windows, macOS, and Most Unix variants using the GTK+ toolkit

Moderator: Renato

PMaff
Super User
Posts: 86
Joined: Sun Aug 11, 2019 1:57 pm
Are you a spam bot?: No

CXX20 ? Cannot compile on older systems.

Post by PMaff »

Hello,

I tried the latest Beta version today and cmake said:
-- Module support is disabled.
-- Version: 8.1.1
-- Build type:
-- CXX_STANDARD: 20
-- Performing Test has_std_20_flag
CMake Error in /home/pmaff/Technical/Finance/MMEX/latest/moneymanagerex/build/CMakeFiles/CMakeScratch/TryCompile-6JLYmD/CMakeLists.txt:
Target "cmTC_44e44" requires the language dialect "CXX20" (with compiler
extensions). But the current compiler "GNU" does not support this, or
CMake does not know the flags to enable it.


CMake Error at /usr/local/share/cmake-3.30/Modules/Internal/CheckSourceCompiles.cmake:101 (try_compile):
Failed to generate test project build system.
Call Stack (most recent call first):
/usr/local/share/cmake-3.30/Modules/Internal/CheckCompilerFlag.cmake:18 (cmake_check_source_compiles)
/usr/local/share/cmake-3.30/Modules/CheckCXXCompilerFlag.cmake:34 (cmake_check_compiler_flag)
3rd/fmt/support/cmake/cxx14.cmake:12 (check_cxx_compiler_flag)
3rd/fmt/CMakeLists.txt:127 (include)


-- Configuring incomplete, errors occurred!

Does this mean I cannot compile MMEX on older systems anymore just because you switch to C++20 now?
:-(
User avatar
Renato
MVP User
Posts: 866
Joined: Mon Apr 25, 2011 7:36 pm
Are you a spam bot?: No
Location: near Zurich

Re: CXX20 ? Cannot compile on older systems.

Post by Renato »

Renato Forum Administrator (I'm not a developer)
PMaff
Super User
Posts: 86
Joined: Sun Aug 11, 2019 1:57 pm
Are you a spam bot?: No

Re: CXX20 ? Cannot compile on older systems.

Post by PMaff »

Thanks Renato.
I already tried an older commit with C++17 on Ubuntu 18.04.6 LTS, which works:
https://github.com/moneymanagerex/money ... 2848800767

Commit : 35f152115 (2025-05-02)
on
Ubuntu.24.04.noble
with C++20 compiles but seg faults then:
https://github.com/moneymanagerex/money ... 2848787776

The MMEX developers have to decide if they use C++17 or if MMEX loses older platforms like Ubuntu 18.04 with C++20.
guangong
Developer
Posts: 654
Joined: Wed Dec 21, 2011 5:58 am
Are you a spam bot?: No

Re: CXX20 ? Cannot compile on older systems.

Post by guangong »

Thanks @PMaff for reaching out on here and GitHub.

We have upgraded from c++11 to c++20 recently (trakced via MMEX is upgrading to C++20

For MMEX building from scratch on older platforms, upgrading GCC version might help.
User avatar
Renato
MVP User
Posts: 866
Joined: Mon Apr 25, 2011 7:36 pm
Are you a spam bot?: No
Location: near Zurich

Re: CXX20 ? Cannot compile on older systems.

Post by Renato »

Renato Forum Administrator (I'm not a developer)
PMaff
Super User
Posts: 86
Joined: Sun Aug 11, 2019 1:57 pm
Are you a spam bot?: No

Re: CXX20 ? Cannot compile on older systems.

Post by PMaff »

guangong wrote: Sat May 03, 2025 11:44 pm Thanks @PMaff for reaching out on here and GitHub.

We have upgraded from c++11 to c++20 recently (trakced via MMEX is upgrading to C++20

For MMEX building from scratch on older platforms, upgrading GCC version might help.
I have seen that.
I am not convinced, that it is a good idea to go with the incomplete C++20.
I'd suggest to stay with C++17 currently till C++20 is completely implemented in gcc and Microsoft compiler.
At that time it will not matter if we lose older systems like Ubuntu 18.04 .
guangong
Developer
Posts: 654
Joined: Wed Dec 21, 2011 5:58 am
Are you a spam bot?: No

Re: CXX20 ? Cannot compile on older systems.

Post by guangong »

It was downgraded to C++17 to be compatible with old Linux env via https://github.com/moneymanagerex/money ... /pull/7481
PMaff
Super User
Posts: 86
Joined: Sun Aug 11, 2019 1:57 pm
Are you a spam bot?: No

Re: CXX20 ? Cannot compile on older systems.

Post by PMaff »

guangong wrote: Fri May 09, 2025 11:44 pm It was downgraded to C++17 to be compatible with old Linux env via https://github.com/moneymanagerex/money ... /pull/7481
I think, this is a good decision.
As soon as C++20 is completely implemented, the older Linux version will not be a "problem" anyway.

Ubuntu 18.04 LTS works with gcc 7-5-0 .
Thanks!
PMaff
Super User
Posts: 86
Joined: Sun Aug 11, 2019 1:57 pm
Are you a spam bot?: No

Re: CXX20 ? Cannot compile on older systems.

Post by PMaff »

Renato wrote: Sun May 04, 2025 6:22 am For your information: https://github.com/moneymanagerex/money ... r/BUILD.md
Thanks Renato.
The guidance for Linux was partly written by me. ;-)