glog
glog
glog是谷歌开源的C++日志库,这里对glog进行一个简单的学习记录。
c
在CMake中添加glog
CMakeLists.txt
1 | cmake_minimum_required(VERSION 3.16) |
main.cpp
1 |
|
更多详细信息见官网
注意事项
不能在conda环境中编译,否则会报错:/usr/bin/ld: CMakeFiles/cleanup_with_absolute_prefix_unittest.dir/src/cleanup_with_absolute_prefix_unittest.cc.oo:(.data.rel.ro._ZTI47CleanImmediatelyWithAbsolutePrefix_logging_Test[_ZTI47CleanImmediatelyWithAbsolutePrefix_logging_Test]+0x10): undefined reference totypeinfo for testing::Test
。
退出conda环境:
1 | conda deactivate |