MengRao / fmtlog

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

is_trivially_copyable_v #52

Closed jacksionane closed 1 year ago

jacksionane commented 1 year ago

fmtlog.h:483:26: error: ‘is_trivially_copyable_v’ is not a member of ‘std’; did you mean ‘is_trivially_copyable’?

MengRao commented 1 year ago

Per https://en.cppreference.com/w/cpp/types/is_trivially_copyable, is_trivially_copyable_v is introduced from C++17, and fmtlog requires C++17.

jacksionane commented 1 year ago

gcc version 10.2.1 20210130 (Red Hat 10.2.1-11) (GCC)

jacksionane commented 1 year ago

i know gcc 10.2 support C++17,but when i compile it with gcc 10.2,the error appears

MengRao commented 1 year ago

you may need to add -std=c++17 in compile options

jacksionane commented 1 year ago

g++ t.cpp -I . -Wl, -Bstatic -lfmtlog-static -Wl, -Bdynamic -lfmtlog-shared -std=c++17 -o a.out 在原来的基础上添加了-std=c++17之后,报出如下提示 /opt/rh/devtoolset-10/root/usr/libexec/gcc/x86_64-redhat-linux/10/ld: 找不到 : 没有那个文件或目录 │ /opt/rh/devtoolset-10/root/usr/libexec/gcc/x86_64-redhat-linux/10/ld: 找不到 -lfmtlog-static │ /opt/rh/devtoolset-10/root/usr/libexec/gcc/x86_64-redhat-linux/10/ld: 找不到 : 没有那个文件或目录 │ /opt/rh/devtoolset-10/root/usr/libexec/gcc/x86_64-redhat-linux/10/ld: 找不到 -lfmtlog-shared

MengRao commented 1 year ago

fmtlog-static.a和fmtlog-shared.so是fmtlog编译出来的库,路径在fmtlog/.build下面,你需要指定link路径。另外你只需要link一个库就可以了