MengRao / fmtlog

fmtlog is a performant fmtlib-style logging library with latency in nanoseconds.
MIT License
807 stars 124 forks source link

VS2022 编译报错 #71

Open tiantianaixuexi opened 1 year ago

tiantianaixuexi commented 1 year ago

1>ShineLibhv.cpp 1>G:\C++Project\ShineLibhv\third\include\fmtlog\fmtlog.h(595,32): error C2589: “(”:“::”右边的非法标记 1>G:\C++Project\ShineLibhv\third\include\fmtlog\fmtlog.h(598,1): message : 查看对正在编译的 类 模板 实例化“std::vector<fmt::v9::basic_format_arg,std::allocator<fmt::v9::basic_format_arg>>”的引用 1>G:\C++Project\ShineLibhv\third\include\fmtlog\fmtlog.h(721,2): message : 查看对正在编译的 类 模板 实例化“fmtlogT<__>”的引用 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\vector(497,5): fatal error C1903: 无法从以前的错误中恢复;正在停止编译

感觉是和 minwindef.h 的 max 宏冲突了

image

linuxaged commented 1 year ago

尝试增加宏定义:NOMINMAX target_compile_definitions(${PROJECT_NAME} PRIVATE -DNOMINMAX)