我正在为我的C++程序使用google glog库。我以前使用过glog库,所以我知道当检查失败时,它应该会打印出堆栈跟踪。但它不会为我的程序打印任何堆栈跟踪:
#include <glog/logging.h>
void bar(int x) {
CHECK_EQ(x, 1);
}
void foo(int x) {
bar(x + 1);
}
int main() {
foo(1);
}Makefile是
all: Makefile test.cpp
g++ -g -O3 test.cpp -lglog -o test我得到的输出是
$ ./test
WARNING: Logging before InitGoogleLogging() is written to STDERR
F0629 14:09:45.900789 37730 test.cpp:4] Check failed: x == 1 (2 vs. 1)
*** Check failure stack trace: ***
Aborted我是不是漏掉了什么?
谢谢!
Cui
https://stackoverflow.com/questions/38062352
复制相似问题