Closed jacksionane closed 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.
gcc version 10.2.1 20210130 (Red Hat 10.2.1-11) (GCC)
i know gcc 10.2 support C++17,but when i compile it with gcc 10.2,the error appears
you may need to add -std=c++17 in compile options
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
fmtlog-static.a和fmtlog-shared.so是fmtlog编译出来的库,路径在fmtlog/.build下面,你需要指定link路径。另外你只需要link一个库就可以了
fmtlog.h:483:26: error: ‘is_trivially_copyable_v’ is not a member of ‘std’; did you mean ‘is_trivially_copyable’?