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
If you complile your C++ program using
CC hello.cppTo Run the program, type
Once you are on Hercules, the command to compile your C++ program is
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
|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.