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

vs2022 上编译报错c2955 #47

Open
zhangwen-sys opened this issue Jul 22, 2022 · 5 comments
Open

vs2022 上编译报错c2955 #47

zhangwen-sys opened this issue Jul 22, 2022 · 5 comments

Comments

@zhangwen-sys
Copy link

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

@MengRao
Copy link
Owner

MengRao commented Aug 1, 2022

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

@gh-andre
Copy link

@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.

@longmao-yiran
Copy link

longmao-yiran commented Feb 1, 2023

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

@gh-andre
Copy link

gh-andre commented Feb 2, 2023

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

@xhd1221
Copy link

xhd1221 commented Oct 28, 2024

today I encountered this issue as well. i adjusted many things but the issue was still there. eventually, i realized that i was using C++ 14 which is the default C++ standard of VS 2022 project. after switched to C++ 17, everything goes fine.

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

5 participants