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

Errors in SucroseConversion.cpp when Compiling on Windows 10 under Visual Studio 2022 #743

Closed
Lubart opened this issue Apr 14, 2023 · 3 comments

Comments

@Lubart
Copy link

Lubart commented Apr 14, 2023

Errors:
4>SucroseConversion.cpp
4>D:\Git\brewtarget\src\measurement\SucroseConversion.cpp(47,55): error C2370: 'Measurement::sucroseConversions': redefinition; different storage class
4>D:\Git\brewtarget\src\measurement/SucroseConversion.h(33,35): message : see declaration of 'Measurement::sucroseConversions'
4>D:\Git\brewtarget\src\measurement\SucroseConversion.cpp(852,31): error C2370: 'Measurement::sucroseConversions_size': redefinition; different storage class
4>D:\Git\brewtarget\src\measurement/SucroseConversion.h(35,24): message : see declaration of 'Measurement::sucroseConversions_size'
4>D:\Git\brewtarget\src\measurement\SucroseConversion.cpp(852,31): error C2737: 'Measurement::sucroseConversions_size': constexpr object must be initialized

@Lubart
Copy link
Author

Lubart commented Apr 22, 2023

Looks like error in declaration should be const instead of constexpr:
size_t const Measurement::sucroseConversions_size = std::size(Measurement::sucroseConversions);
and
Measurement::SucroseConversion const Measurement::sucroseConversions[] = { ...

Can anybody fix that?

@matty0ung
Copy link
Contributor

Yes, should be an easy fix.
Always good to run the code through another compiler, as you discover more bugs / potential bugs.

@matty0ung
Copy link
Contributor

I hope this is fixed in https://github.com/Brewtarget/brewtarget/releases/tag/v3.0.8, but I don't have Visual Studio installed, so have not checked directly. Please reopen this issue if the problem persists.

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