Closed catoxliu closed 1 year ago
It still works in 17.6.2, I will update and recheck.
I have updated VS and it still compiles. Are building using the public nuget packages, or do you use locally built versions? Have you applied any change to the code?
@axodox , thanks for your quick reply.
Are building using the public nuget packages, or do you use locally built versions?
using public nuget packages, all update to latest.
Have you applied any change to the code?
No, just change the certificate as the documentation suggested.
All the google results point that compiler should use C++ 20, which I have checked and confirmed
Here's the whole build log, there're other errors but all related to the precompiled header. unpaint_build.log
Some update.
Since you mentioned build the module locally, so I tried to build "axodox-common" as well, having the same error. So I go to "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.34.31933\include\format" to have a look, because according to https://en.cppreference.com/w/cpp/utility/format/basic_format_string, it should be in that header file.
But yeah, it's not there, instead I find the equivelent declaration in that file
template <class... _Args>
using _Fmt_string = _Basic_format_string<char, type_identity_t<_Args>...>;
So yeah, by replaceing these two line I can get "axodox-common" compiled successfully now
template<typename... TArgs>
- void log(log_severity severity, const std::format_string<TArgs...> format, TArgs&&... args) const
+ void log(log_severity severity, const std::_Fmt_string<TArgs...> format, TArgs&&... args) const^M
{
...
template<typename... TArgs>
- void log(log_severity severity, const std::wformat_string<TArgs...> format, TArgs&&... args) const
+ void log(log_severity severity, const std::_Fmt_wstring<TArgs...> format, TArgs&&... args) const^M
{
Then I go back to unpaint project and use the same change. Now I only get this error message:
1>C:\workspace\github\unpaint\Unpaint\SettingsViewModel.cpp(24,40): error C2440: '<function-style-cast>': cannot convert from 'initializer list' to 'winrt::Unpaint::AdapterViewModel' 1>C:\workspace\github\unpaint\Unpaint\SettingsViewModel.cpp(24,40): message : Invalid aggregate initialization 1>C:\workspace\github\unpaint\Unpaint\SettingsViewModel.cpp(74,5): error C2440: 'return': cannot convert from 'std::wstring' to 'winrt::hstring' 1>C:\workspace\github\unpaint\Unpaint\SettingsViewModel.cpp(74,5): message : No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Update:
these two errors are easy to fix, can't use wstring directly, has to make it raw string by c_str().
So I finally get it compiled locally : )
All this seems to be that I'm not using the right version of MSVC? would you mind to point which version you're using? thanks
Never mind, using 14.36.32532 MSVC just without any issues. I don't know why my installer choose an old version for me...
Close the issue.
Thanks
Follow the steps and installed all required package. Updated all nuget packages to latest. Windows 11 Visual Studio 2022 17.6.4
errors: