Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VC++ .NET 2003: Debugging an executable

Status
Not open for further replies.

luke13

Programmer
Feb 20, 2005
7
0
0
AU
Compiling and linking using Cygwin rather than the IDE, and don't seem to be able to debug the output executable.

VC++ 6.0 will load the executable, but complains that there is no debug information.

Noob with VC++ .NET 2003, it doesn't even seem to be able to load an executable file for debugging. Do i need to hard code a break point in the code, run it, then attatch to the running process (certainly hope not!) ??

When cl is called to compile the object files, passing it /Yd and /Zi. When linking use /Zi (also tried /link /DEBUG). Yet VC++ 6.0 still says there is no debug info. Is this because the version of cl that comes with .NET 2003 has a different format for the debug information? Tried using /Z7 instead of /Zi incase this was the prob, but no joy.

Any help would be greatly appreciated.
 
If anyone is interested, here is the solution...

Firstly, should have RTFM! The info printed by "cl /?" is very terse and a bit misleading, the MSDN site gives much better descriptions of the command line options.

As a lot of the code in this project is first built as a library, then linked into an application, the debug info must be stored in the object files. So compile with /Yd /Z7.

When linking /link /DEBUG is required.

VC++ 6.0 still complains that there is no debug info, but .NET 2003 works fine. Possibly 6.0 could find the debug info, if the executable had been compiled and linked with it's version of cl? Don't know, havent tried.

To debug the executable in .NET had to launch it from the command line,
devenv /debugexe application-name
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top