|
South Central USA Regional Programming Contest |
|
||
Local Contest
Home Schedule Information Details FAQ Contest Details Welcome Rules Hints Environment Compile Howto Results Contest Report Contest Results Problems Data Solutions PC^2 About PC^2 Documentation ACM Intl Prog Contest South Central US Regional Registration |
This page will list a number of useful processes that may be helpful to contest competitors.
How to run an executable in the current directoryFor security reasons, the current directory is NOT in your path. This means that if you wish to run the executable hello that is in the same directory that you are in, you must type: ./hello. This says to explicitly run the hello executable that is in the current directory. Return to Top of Page
Compile a C program with gccThe gcc command is used to invoke the GNU C compiler. Both input source file and executable file name must be specified. This is the command to use if you have a C source file called hello.c and wish to create the executable file hello. gcc hello.c -o helloTo utilize gcc version 3, you would type the following: gcc3 hello.c -o helloIf you are including <math.h> do not forget to put the -lm at the end of the compile line. gcc3 hello.c -o hello -lm Return to Top of Page
Compile a C++ program with g++The g++ command is used to invoke the GNU C++ compiler. Both input source file and executable file name must be specified. This is the command to use if you have a C++ source file called hello.cpp and wish to create the executable file hello. g++ hello.cpp -o helloTo utilize gcc version 3, you would type the following: g++3 hello.cpp -o hello Return to Top of Page
Using Kylix C/C++ GUIWhen you start the Kylix C/C++ GUI, it assumes you wish to make a GUI application. The following steps will get you to the point where you can write a console application.
The following line in your source causes a three line Kylix license message to be displayed each time you run your program. These are the lines that will be at the top: displayed. The line is: This application must be distributed under the terms of the GNU General Public License (GPL), version 2. A copy of this license can be found at: http://www.borland.com/kylix/gpl.html. Return to Top of Page
Command line compile of a C program with KylixKylix uses the same command to invoke both the C and the C++ compilers: bc++. You need only specify the name of the source file. It automatically creates an executable (if compilation and linking are without error) that is the same name as the source file when you remove the extension. bc++ hello.cThis command will produce the executable: hello. Return to Top of Page
Command line compile of a C++ program with KylixKylix uses the same command to invoke both the C and the C++ compilers: bc++. You need only specify the name of the source file. It automatically creates an executable (if compilation and linking are without error) that is the same name as the source file when you remove the extension. bc++ hello.cppThis command will produce the executable: hello. Return to Top of Page
Using Kylix Delphi GUIWhen you start the Kylix Delphi GUI, it assumes you wish to make a GUI application. The following steps will get you to the point where you can write a console application.
The following line in your source causes a three line Kylix license message to be displayed each time you run your program. You can remove this line and the message will not be displayed. The line is: {$APPTYPE CONSOLE} Return to Top of Page
Command line compile of a delphi program with KylixKylix uses the dcc command to invoke the Delphi (Pascal) compiler. You need only specify the name of the source file. It automatically creates an executable (if compilation and linking are without error) that is the same name as the source file when you remove the extension. dcc hello.pasThis command will produce the executable: hello. Return to Top of Page
Kylix output quirkWhen you run an executable created with Kylix (c, c++, or Pascal), you will always see the following lines at the top of your printout: This application must be distributed under the terms of the GNU General Public License (GPL), version 2. A copy of this license can be found at: http://www.borland.com/kylix/gpl.html. Return to Top of Page
Compile a Java program with Sun JDKThe javac command is used to compile java source files. javac hello.javaThis will produce java.class. Return to Top of Page
Execute a compiled Java programThe java command is used to execute java class file. java hello Return to Top of Page
|
[Printable]
LSU Home Search Campus Map ACM Chapter Computer Science Computing Services Our Contests 2002 2001 2000 Index |