【软件】CentOS安装使用g++、gdb

Linux C

yum install gcc-c++
g++ -o main -O0 main.c -g

intrusive way:

#define Debug 1

#if Debug
printf();
fflush();
#endif

gdb way:

  1. tell compiler to record variables' name
  2. tell compiler to turn off optimizations(can be set in Makefile)
posted @ 2021-08-10 09:14  楚不予  阅读(132)  评论(0编辑  收藏  举报