Compile with -g option but “Single stepping until exit from function main, which has no line number information”

后端 未结 3 1213
终归单人心
终归单人心 2021-01-18 23:28

I have some trouble with gdb. This is my code in a single file named main.cpp

#include 

void myfunc();

int main(){
    char msg[] = \"Hello         


        
3条回答
  •  心在旅途
    2021-01-19 00:09

    Try to use '-Og', too. Maybe that will help, because as @KevinDTimm wrote: compiler may optimize it.

    Reference:

    • "c++ --help=optimizers"

提交回复
热议问题