No debugging symbols in gdb even when compiling with -g flag

前端 未结 6 399
一个人的身影
一个人的身影 2021-01-17 12:54

I am trying to compile my program with debugging symbols for use in gdb. I have added the -g flag to my makefile but I still get \"Reading symbols from ...(no debugging symb

6条回答
  •  梦毁少年i
    2021-01-17 13:52

    I think you need -g when linking the object into a binary code.

    CPP = g++
    CFLAGS = -g -Wall
    
    $(BIN): $(OBJ)
     $(CPP) $(CFLAGS) $(OBJ) -o $(BIN) $(LDFLAGS) $(LIBS)
    
    : 
     $(CPP) $(CFLAGS) -c  -o 
    

提交回复
热议问题