title: Compile with -g option but "Single stepping until exit from function main, which has no line number information"
body: <p>I have some trouble with gdb.
  This is my code in a single file named main.cpp</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  void myfunc();
  
  int main(){
      char msg[] = "Hello World!";
      myfunc();
  
      std::cout &lt;&lt; msg &lt;&lt; std::endl;
  
      return 0;
  }
  
  void myfunc(){
      int boo = 16;
  }
  </code></pre>
  
  <p>I used this command to compile this code :</p>
  
  <pre><code>g++ -g -Wall main.cpp -o foo
  </code></pre>
  
  <p>Next, I used gdb : </p>
  
  <pre><code>$ gdb foo
  (gdb) start
  Temporary breakpoint 1 at 0x80487c3
  Starting program: /home/laptop/workspace/foo 
  
  Temporary breakpoint 1, 0x080487c3 in main ()
  (gdb) s
  Single stepping until exit from function main,
  which has no line number information.
  Hello World!
  __libc_start_main (main=0x80487c0 &lt;main&gt;, argc=1, ubp_av=0xbffff3a4, init=0x80488b0 &lt;__libc_csu_init&gt;, fini=0x8048920 &lt;__libc_csu_fini&gt;, rtld_fini=0xb7fed280 &lt;_dl_fini&gt;, stack_end=0xbffff39c) at libc-start.c:258
  258 libc-start.c: No such file or directory.
  </code></pre>
  
  <p>What did I do wrong ?
  I use the -g option but I still got this error.</p>
  
  <p>Configuration :</p>
  
  <ul>
  <li>GDB : GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04</li>
  <li>GCC : g++ (Ubuntu 4.8.1-2ubuntu1~12.04) 4.8.1</li>
  </ul>
  
  <p>I installed these tools with a classic : sudo apt-get install </p>
  
  <p>Thank you by advance for any answer :-)</p>