1 / 33

Graphical Development Environments for C++

Explore Eclipse and Visual Studio, two widely available graphical development environments for C++. Eclipse is an open-source debugging environment available on multiple platforms, while Visual Studio is specific to Windows but renowned for its multi-threaded debugger. This session will guide you through creating a C++ project, building and fixing code, setting breakpoints, and exploring program output.

mfernandes
Download Presentation

Graphical Development Environments for C++

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Graphical Development Environments for C++ • Eclipse • Widely available open-source debugging environment • Available on Windows, Linux, others • Designed to use g++ and other existing open-source tools • Unfortunately not working on Urbauer Windows machines • Visual Studio • Specific to Windows but still widely used • Excellent multi-threaded debugger, eases Windows development • Uses Visual C++ (and other tools for other languages) • Works fine on Urbauer machines, so we’ll use this for now

  2. Overview of Today’s Session • Start Visual Studio and create a C++ project • Look at the code and files it generated automatically • Create a simple “hello, world!” program • Build, fix, and repeat until the program compiles • Set breakpoints and step over lines of the program • Look at the program’s output in the debug terminal • Stepping off the end of the main program • Into the crtexe.c file from which the main function is called • Try printing out the program’s name (in argv[0]) • Look at different syntaxes for the main function • How those different forms treat argc and argv, for example

  3. Starting Visual Studio

  4. Choosing Visual C++

  5. Click on Create Project

  6. Choose Win32

  7. Fill in Project Name

  8. Click Finish to Create the Project …

  9. … Which May Take it a While to Do

  10. Visual Studio Generated Several Files

  11. Provided StdAFX Header File

  12. Provided StdAFX Source File

  13. Provided Readme.txt File

  14. Have the Program Print Out Hello, World

  15. Build the Program

  16. What do the Errors Tell Us We Missed?

  17. Corrected Program

  18. Build Again

  19. Successful Compilation

  20. Setting a New Breakpoint

  21. Breakpoint in the main Function

  22. Start Debugging

  23. Debugger Stops at the Breakpoint

  24. Stepping over the First Line

  25. After Stepping Over Once

  26. Program Output in Terminal Window

  27. Stepping Over a Second Time

  28. At The End of the main Function

  29. What if we Stepped Over Once More?

  30. In the crtexe.c file (calls different Mains)

  31. F5 or Continue to Complete the Run

  32. All Done (can close crtexe.c now)

  33. A Couple More Things to Try • Exercise: what do you see when you have the program print out argv[0]? • Why does it print that? • What is it printing vs. what we saw in previous sessions? • Exercise: change syntax of the main function to match what we used in earlier sessions • What does printing argv[0] show now? • What if you print out the other program arguments?

More Related