UMW Computer Science
and Apple® XCode

photo
courtesy of www.apple.com/xcode
More and more developers are embracing
Mac OSX as the platform of choice due to its UNIX-based architecture (FreeBSD),
but consumer-friendly GUI (Aqua). The deal gets even sweeter when you consider
that Apple gives away free development tools with each copy of OS 10.
The University of Mary Washington
Computer Science Department uses an HP-UX server called "Paprika"
for instructional purposes. However, you can also choose to develop your classroom
applications on your personal machine and it will run just fine on the school's
system (although a re-compile will be necessary). Because XCode (Apple's development
tools) and UMW both use the free, open source GCC compiler, moving from your
personal workstation to Paprika is easy. However, there are a few differences.
The aim of this page is to highlight those differences so you can easily and
effectively develop your classroom projects using XCode.
General Notes:
- XCode is much more picky than
Paprika. Therefore, even after taking the steps as outlined below, you may
have warnings pop up in XCode that will not occur when you compile the exact
same code on Paprika. In general, take warnings that you get under XCode with
a grain of salt. However, do not ignore any warnings you may receive on Paprika.
Warnings on Paprika typically indicate a fundamental problem in your code
and must be taken seriously. In addition, the UMW Coding standards state that
your program must compile without any warnings in order to avoid loosing points.
Quick Steps for students of CPSC
110:
- Open XCode, and Select "New
Project..." under the File menu.
- Scroll down to C++ Tool under
the "Tool" section of the Assistant pane. Click Next, and then enter
the following information, and click Finish to begin coding!
- Place "using namespace std;"
in the top of your main.cpp file before anything else (other than comments).
This line will be practically ignored by Paprika, but is essential for XCode
to compile your program correctly.
- To build and run your program,
you can either navigate to your directory in the Terminal (Applications >
Utilities > Terminal.app) and type "g++ main.cpp" and run the
resulting a.out file, or you can hit the "Build and Run" icon in
XCode. Note that you will have to use the Terminal if you want to redirect
standard input.
- After you are finished coding,
use an FTP application like RBrowser
Lite in order to transfer your source files to Paprika, and then compile
and run it there to make sure there aren't any weird issues that arise.
For CPSC 220 and beyond:
- If you write a class, you must
include both the header and implementation file under the "headers"
section of the "target." The following screenshot should illustrate
what I mean by this. Why XCode makes you do this is beyond me.

Page written by Jeffrey
Longo
Created 06/23/2004
Last Modified
06/23/2004