If you don't have hello.cpp, you can click on this link hello.cpp and manage to get a copy for yourself.
The command to compile your C++ program on Solaris is
CC program_nameFor example, if you compile hello.cpp this way:
CC hello.cpp -o helloYou would run the program, by typing
hello
If you complile your C++ program using
CC hello.cppTo Run the program, type
a.out
ssh hercules
Once you are on Hercules, the command to compile your C++ program is
CC
REMEMBER! IT IS CAPITAL CC.
Here is an example of compiling a program named hello.cpp,
using
CC hello.cpp -o helloto compile and then using
helloto run the program.
If you complile it using
CC hello.cppthen Run the program by typing
a.out
| CC | UNIX is case sensitive, capital CC is a C++ compiler command. |
| hello.cpp | Your C++ program name |
| -o hello | The "-o" is used to create an executable file as specifiled by the name following -o. When you don't use "-o", the executable filename will be called a.out. |
Copyright: Department of Computer Science, University of Regina.