[Cal Poly Logo] [Computer Science Dept Lab]

Compiling Programs on Your Intranet Account

C++ Fortran 77 Java Tutorials Other Compilers Debugging

C++ Programs

1. Use an editor to create the source file, for example HelloWorld.cpp
2. Compile the source file by typing
g++ -o HelloWorld HelloWorld.cpp
(the -o option is used to specify the name of the executable program)
3. Run the program by typing
HelloWorld

Type    man g++    at the %prompt to read the manual pages. For further information read the

Gcc online documentation
GNU C++ information

If you need information regarding managing large projects, read the information about the make utility and Dr. Soroka's CS 256 handout An overview about using the gcc compiler and make utility can be found in the Stanford University Unix Programming Tools document. (See sections 1 & 2).

Fortran 77 Programs

1. Use an editor to create the source file, for example Hello.for
2. Compile the source file by typing
g77 -o Hello Hello.for
(the -o option is used to specify the name of the executable program)
3. Run the program by typing
Hello

For further information read the GNU Fortran (g77) Reference pages

Java Programs

1. Use an editor to create the source file, for example HelloWorldApp.java
2. Compile the source file by typing
javac HelloWorldApp.java
3. Run the program by typing
java HelloWorldApp

Note: If you prefer to use an integrated development environment, use the js command to run Java Studio or use the jws command to run Java Workshop.

Additional Information for Java Programmers can be found at http://www.csupomona.edu/~cs/department/labs/help_pages/Java_Notes.html

Training and Tutorials

There are many web sites which provide tutorials and training in various programming languages. These pages provide links to these sites:
Programmingtutorials.com
Computer Education, Training & Tutorial Resources

[Return to Lab Home Page]


Page Created by Joy Compton -- jcompton@csupomona.edu
Last Revised: Dec 8, 2000