How to run a C++ program in the CodeWarrior environment

  1. Double click on the CodeWarrior IDE 1.7.4 icon to start the CodeWarrior programming environment. The path to this icon is:

    NEBULA.MACAPPS/Codewarrior/Metrowerks CodeWarrior/CodeWarrior IDE 1.7.4 So first select and click on the NEBULA.MACAPPS icon to open this file server. In the window that displays the contents of this file server, you should see an icon called Codewarrior; select and click on this icon to open the Codewarrior folder. In this folder you should see an icon called Metrowerks CodeWarrior; select and click on this icon to open the Metrowerks CodeWarrior folder. In this folder you should see the CodeWarrior IDE 1.7.4 icon. Select and click on this icon to start the compiler.

  2. From the File menu choose the New Project... option.

  3. This will bring up a window with a list of five items: Click on 22C16 Project and then click on OK.

  4. This will bring up a dialog box that will ask you to name your project and save it in some location. The convention seems to be to assign the extension to a project name. So for example, you could name your project test. and save it. The symbol can be produced on the Macintosh by pressing the alt/option key and M simultaneously. The compiler saves your project in a newly created folder that has the same name as the project. So for example, if you save test. on the desktop, then the compiler will create a folder called test on your desktop and will save test. inside that folder. You should bring with you a 3.5'' floppy diskette to save your work on. Please do not save your work on the hard drive of the machine you are using and expect to find it there later!

  5. After you have completed Step 4, a window called test. will pop up. This window will contain a list of all the items in your project. A project is supposed to contain all files that are needed to compile and run your program. In general, these files may include Libraries and source code files.

  6. Select the New option from under the File menu. This will give you a window within which you can type your C++ program.

  7. After you are done typing a C++ program, save the file using the Save As... option in the File menu. The extension to use for C++ programs is cpp. So you might want to save your file as test.cpp. You might also want to save this file in the folder created in Step 4.

  8. Then click on the Add Files... option in the Project menu to add the file test.cpp to the project. You will notice a file called main.cpp in your project. Delete this by clicking on it and then using the Remove Files... option from the Project menu.

  9. Compile and run your program using the Run Option in the Project menu. If the Run option does not show up in the Project menu, then disable the debugger.

  10. When your program is run it will produce a window that will contain all your interactions with the program. In particular, all the input that you type and all the output produced by the program will be displayed in this window. After your program has finished running you should click on Quit (which is an option under the File menu) to get rid of this window.



Sriram Pemmaraju
Thu Jun 12 10:46:48 CDT 1997