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

Compiling fmt::print(L"Testing") fails #1609

Closed
risa2000 opened this issue Mar 27, 2020 · 1 comment
Closed

Compiling fmt::print(L"Testing") fails #1609

risa2000 opened this issue Mar 27, 2020 · 1 comment

Comments

@risa2000
Copy link

With VS2019 16.5.1, and fmtlib from the repo, I cannot compile following code:

#include <fmt/format.h>

int main(int argc, char* argv[])
{
    fmt::print(L"Testing");
    return 0;
}

The error I am seeing is:

------ Build All started: Project: fmt_test, Configuration: x64-Debug ------
[1/2] C:\PROGRA2\MICROS2\2019\COMMUN1\VC\Tools\MSVC\14251.286\bin\HostX64\x64\cl.exe /nologo /TP -DFMT_LOCALE -ID:\Dev\include -ID:\Dev\crtdll\include /DWIN32 /D_WINDOWS /GR /EHsc /Zi /Ob0 /Od /RTC1 -MDd -std:c++17 /showIncludes /FoCMakeFiles\fmt_test.dir\fmt_test.cpp.obj /FdCMakeFiles\fmt_test.dir\ /FS -c ......\fmt_test.cpp
FAILED: CMakeFiles/fmt_test.dir/fmt_test.cpp.obj
C:\PROGRA2\MICROS2\2019\COMMUN1\VC\Tools\MSVC\14251.286\bin\HostX64\x64\cl.exe /nologo /TP -DFMT_LOCALE -ID:\Dev\include -ID:\Dev\crtdll\include /DWIN32 /D_WINDOWS /GR /EHsc /Zi /Ob0 /Od /RTC1 -MDd -std:c++17 /showIncludes /FoCMakeFiles\fmt_test.dir\fmt_test.cpp.obj /FdCMakeFiles\fmt_test.dir\ /FS -c ......\fmt_test.cpp
D:\Dev\crtdll\include\fmt\core.h(1782): error C2664: 'void fmt::v6::internal::vprint_mojibake(FILE *,fmt::v6::string_view,fmt::v6::format_args)': cannot convert argument 2 from 'fmt::v6::basic_string_view<wchar_t>' to 'fmt::v6::string_view'
D:\Dev\crtdll\include\fmt\core.h(1783): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
D:\Dev\crtdll\include\fmt\core.h(1662): note: see declaration of 'fmt::v6::internal::vprint_mojibake'
......\fmt_test.cpp(5): note: see reference to function template instantiation 'void fmt::v6::print<wchar_t[8],,0>(const S (&))' being compiled
with
[
S=wchar_t [8]
]
ninja: build stopped: subcommand failed.

Build All failed.

vitaut added a commit that referenced this issue Mar 28, 2020
vitaut added a commit that referenced this issue Mar 28, 2020
vitaut added a commit that referenced this issue Mar 28, 2020
vitaut added a commit that referenced this issue Mar 28, 2020
vitaut added a commit that referenced this issue Mar 28, 2020
vitaut added a commit that referenced this issue Mar 28, 2020
@vitaut
Copy link
Contributor

vitaut commented Mar 28, 2020

Fixed in 80ce222. Thanks for reporting.

@vitaut vitaut closed this as completed Mar 28, 2020
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