[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] No source available for "main() "

1. Unable to debug: You probably haven't built for debug. Use the -g -O0 options to the compiler for debug build
2. Highlight moving randomly: This is probably becuase you have built for debug, but with a high level of optimisation. When optimised, the compiler will move code around to make it optimal, but this pretty much break the association with the source - hence what you are seeing.

Michael Chen wrote:
hey, there,

I imported an existing C project with working Makefiles. And in the
project property, I ticked off "Use default build" and "Generate
Makefile Automatically", and I supplied the Bulding command
"/usr/bin/make". The project build smoothly and run without problem.
And in the editor windows, CTRL+click on variable names, types or
macros,  leads me to all right places.

However I can not debug it. The error is No source available for
"main() " . I setup the Source  in the Run/Debug Dialog in all
possible ways I can imagine, and get the same error. There is another
executable generated in a deep subdirectory, and I can at least see
the debug window for it, click on Step Over, however, I see the
highlights jumps around in its source file randomly. It seems that I
missed something. Please help me out, thanks!

Best Regards, Michael Chen

OS Ubuntu 8.04 - the Hardy Heron - released in April 2008

Build id: M20071023-1652

Version 4.03 20080225
cdt-dev mailing list