CS 1621

How to Compile and Run Programs in various languages:

Smalltalk:  gst is available on Unixs.  It is invoked by:

          gst <filename1> <filename2> … <filenameK>

where each of the files is compiled and executed in the order listed.

 

C++: If you use Visual Studio, as you should know from lecture, I am the wrong person to show you usage procedures.

          If you use g++ (ex: on Unixs or Linux) you can compile and run C++ programs in a simple 2-step way:

          g++ progname.cpp

          above command compiles program, generating a.out executable file

     ./a.out

          above executes the program, even if the current directory is not

          in your path.

         

Ada: the easiest way to compile/run Ada programs is on a Unixs machine.  From the unixs prompt do the following:

/usr/local/gnat/bin/gcc –c progname.adb

above command compiles program using gcc-based Gnat compiler

/usr/local/gnat/bin/gnatbl –o progname progname.ali

above command links intermediate code to form final executable called progname

 

Java: first you need to make sure your computer has the JDK installed on it.  This should be on all campus machines.  If you want to install it onto your own PC, you can download it from the java.sun.com Web site.  Once you know Java is installed, do the following from the PC command prompt:

          javac progname.java

          above command compiles Java source code into byte code

          java progname

          above command interprets the compiled byte code

 

Perl: Perl should be installed on Unixs.  To run a Perl program, just type"

            perl progname.pl

 

Prolog: If you want to run Prolog programs, you will need to download and install this yourself.  Here are some links:

          http://www.swi-prolog.org/

          http://www.gnu.org/software/gprolog/gprolog.html

 

Lisp:  If you want to run List programs, you will need to download and install this yourself.  Here is a link:

            http://www.thefreecountry.com/compilers/commonlisp.shtml