C++ プログラムに google glog ライブラリを使用しています。以前に glog ライブラリを使用したことがあるので、CHECK エラーが発生したときにスタック トレースを出力する必要があることを知っています。しかし、私のプログラムのスタック トレースは出力されません。
#include <glog/logging.h>
void bar(int x) {
CHECK_EQ(x, 1);
}
void foo(int x) {
bar(x + 1);
}
int main() {
foo(1);
}
メイクファイルは
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
ここで何か不足していますか?
ありがとうございました!
崔