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
Compile using -g and -ggdb flags.
-g
-ggdb
Your command should be
g++ -g -ggdb -Wall main.cpp -o foo