Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ 20 standard support. #147

Closed
MarcoFilimonE opened this issue Dec 6, 2024 · 10 comments
Closed

C++ 20 standard support. #147

MarcoFilimonE opened this issue Dec 6, 2024 · 10 comments

Comments

@MarcoFilimonE
Copy link

Hello!
Is there any chance to add support for C++ 20 standard?

@beltoforion
Copy link
Owner

Do you have any indication that it does not compile on a C++20 compliant compiler? What part of the code is not C++20 compliant?

@MarcoFilimonE
Copy link
Author

MarcoFilimonE commented Dec 6, 2024

We're using the conan2 package from: https://conan.io/center/recipes/muparser
We've just upgraded our conan profile to cpp 20 and now the build of the package is failing.

image

@beltoforion
Copy link
Owner

I cannot find anything suspicious in the line referenced in the error message and i can compile Version 2.3.4 with Visual Studio.

@MarcoFilimonE
Copy link
Author

MarcoFilimonE commented Dec 9, 2024

Which version are you using? (of VS)

@beltoforion
Copy link
Owner

beltoforion commented Dec 9, 2024

VS2022; I opened the folder and build it with CMake; The compiler used was MSCV Version 1942

@MarcoFilimonE
Copy link
Author

Ok, thanks for the information. Might be a problem with the Conan package, then. Are you the one who maintains it?

@beltoforion
Copy link
Owner

beltoforion commented Dec 10, 2024

No I'm not the maintainer. Is there an easy way to reproduce the issue? I'm unfamiliar with Conan.

@MarcoFilimonE
Copy link
Author

If I download your latest realese's source code and I change the CMake from
set(CMAKE_CXX_STANDARD 11)
to
set(CMAKE_CXX_STANDARD 20)

and then I run

  1. cmake -G "Visual Studio 16 2019" -A x64 -B build/
  2. cmake --build build/ --config RelWithDebInfo --parallel --verbose -- /p:CL_MPcount=%NUMBER_OF_PROCESSORS%

I get:

image

@beltoforion
Copy link
Owner

beltoforion commented Dec 10, 2024

Thats something i can work with. This has nothing to do with C++20. For some reason min and max are defined as macros. If you put #undef min and #undef max at the top of the file it should build. I will look for a more elegant solution than that today evening.

beltoforion pushed a commit that referenced this issue Dec 10, 2024
Added NOMINMAX option for building with MSVC
Set C++ standard to C++20
@beltoforion
Copy link
Owner

As far as i can tell the issue should be fixed. I will prepare a new service release 2.3.5 soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants