fmtlog icon indicating copy to clipboard operation
fmtlog copied to clipboard

vs2022 上编译报错c2955

Open zhangwen-sys opened this issue 1 year ago • 4 comments

错误 C2955 “fmt::v8::basic_format_args”: 使用 类 模板 需要 模板 参数列表 错误 C2955 “fmt::v8::basic_format_args”: 使用 类 模板 需要 模板 参数列表 错误 C2661 “fmtlogT<0>::vformat_to”: 没有重载函数接受 2 个参数

zhangwen-sys avatar Jul 22 '22 08:07 zhangwen-sys

能给出编译错误代码行号吗?

MengRao avatar Aug 01 '22 03:08 MengRao

@zhangwen-sys

Try changing /std:c++latest to /std:c++17 in CMakeLists.txt, in this location.

if(MSVC)
    add_compile_options(/std:c++latest)
else()
    add_compile_options(-Wall -O3 -std=c++17)
    #add_compile_options(-Wall -Ofast -std=c++2a -march=skylake -flto -fno-exceptions -fno-rtti -fno-unwind-tables -fno-asynchronous-unwind-tables -DFMTLOG_NO_CHECK_LEVEL=1)
    #SET(CMAKE_AR  "gcc-ar")
    #SET(CMAKE_RANLIB  "gcc-ranlib")
    link_libraries(pthread)
endif()

The latest in VC++ introduces new constructs that may get in the way, like consteval.

gh-andre avatar Nov 17 '22 23:11 gh-andre

@gh-andre I have tried but it doesn’t work

longmao-yiran avatar Feb 01 '23 03:02 longmao-yiran

Works for me in this branch. The actions build it in VS2022 on Windows.

https://github.com/gh-andre/fmtlog/tree/v2-2-1-patches

gh-andre avatar Feb 02 '23 03:02 gh-andre