www.delorie.com/djgpp/v2faq/faq099.html   search  

| Previous | Next | Up | Top |

12.6 GDB finds only .cc source

Q: When I try to debug my C++ programs, the debugger claims it can't find the source file:

      file.cc: No such file or directory.

The source file is there, but it's called file.cpp, not file.cc. Why does this happen?
A: It's a bug in GCC 2.7.2 and earlier. It erroneously assumes that a C++ source always has a .cc extension. If you are using GCC 2.7.2.1 or earlier, you'd better call your C++ files *.cc. If this is unacceptable, you can work around this bug by invoking cc1plus and the assembler pass manually. The bug in GCC manifests itself in that cc1plus is called with the option -dumpbase file.cc. If you replace this with -dumpbase file.cpp (or whatever your extension is), the debugger will happily find your sources.

GCC 2.8.0 and later corrects this bug, so upgrading is also a solution.


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright ⌐ 1998   by Eli Zaretskii     Updated Sep 1998  

Powered by Apache!

You can help support this site by visiting the advertisers that sponsor it! (only once each, though)