Computer Science I
MC140.01
Spring 2001
Quick & Dirty CodeWarrior

  1. Install CodeWarrior on your PC. It is okay to use the "Academic Install", which requires less disk space than the "Full Install". Note, however know that the "Academic Install" does not install all of the on-line manuals or programming libraries.

  2. Create a folder where you will keep your assignments, e.g., mc140.

  3. Start up CodeWarrior, either by clicking on the desktop called CodeWarrior IDE, or by selecting from the Start menu: Start - Programs - CodeWarrior Pro 5 - CodeWarrior IDE.

  4. Create a new project. Select File - New - Win32 C/C++ Application Stationery. Then enter ass1 in the Project name box. Then in the Location box, select the folder you created in step 2, with "/ass1" appended to it (e.g. mc140/ass1). This may happen automatically when you enter ass1 as the project name. Then click on OK. A window will pop up with some choices. Select C Console App and click on OK. Now your project has been created and the appropriate libraries have been attached automatically.

  5. Create your source code. The automatic project creation step (above) creates one source code file called main.c, which contains the code for "Hello world", as we've done in class. This source code file will be what you pass in to be marked, so you need to rename it from main.c to <your-user-name>-ass1.c. This takes three steps. First you rename the file, second you add the file to your project and third you remove the reference to "main.c" from your project. YOU MUST DO THIS FOR EVERY ASSIGNMENT YOU TURN IN.
    1. Close the project created in the step above (in CodeWarrior, select File - Close). Next go out to your desktop and find your mc140 folder. Inside, there will be a folder called ass1. Inside the ass1 folder, there will be a file called main.c (depending on how your folder view is set up, you may not see the ".c" extension). Click once on main.c and select File - Rename (from the Windows menu), then type in <your-user-name>-ass1. For example, I would type in sklarel-ass1. Now close that folder and go back to your CodeWarrior window.
    2. Inside CodeWarrior, select File - Open and select the ass1 project (the project file is named "ass1.mcp"). The project window pops up, containing three rows: Source, MSL ANSI Libraries and Win32 SDK Libraries. Click on Source once, to highlight it. Now click on Project - Add files. Add the file <your-user-name>-ass1. For example, I would add sklarel-ass1. Click on Add. Then click on OK to add the file to both C Console App Debug and C Console App Release applications. Now the file has been added to Source. If you click on the + next to Source, an icon labeled <your-user-name>-ass1.c should appear.
    3. Click on the + next to Source, and an icon labeled main.c will appear. Click on the main.c icon once, to highlight it. Select Edit - Delete, then click on OK.

    In order to edit your source code, click on the + next to Source. Double click on the icon labeled <your-user-name>-ass1.c, and a window will pop up containing a text editor.

  6. Compile and link your program by selecting Project - Make.

  7. Run your program by selecting Project - Run.

  8. Submit your program by copying your source code file (only!!!) (<your-user-name>-ass1.c) into my professor's folder. Open the Professor's folders, as described below. Double click the folder with my user name (sklarel). Then copy and paste <your-user-name>-ass1.c into the MC140 folder.