I found an old solution to this problem that suggested compiling with -gdwarf-2
, but this solution does not or no longer work for me.
So, running ddd on a compiled file and then double clicking variables always results in the error no symbol <var> in current context
My program is this:
int main()
{
for (int i = 0; i < 10; ++i)
{
}
}
the commands I used are these:
g++ -g -O0 -gdwarf-2 test.cpp; ddd. ./a.out
Versions of the programs:
ddd: GNU DDD 3.3.12 (x86_64-pc-linux-gnu)
gdb: GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
gcc: gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
How can I make this work?