Testing the installation
To test the product installation and the critical search paths, try building, compiling, and running a simple program.
For example:
- Create the following C program:
[hello.c] #include <stdio.h> int main(void) { printf("Hello World!\n"); return 0; }
- Compile the test program. For example:
xlc hello.c -o hello
Note: To use shortcuts to the compiler invocation commands, see Creating shortcuts to the XL C invocation commands. Otherwise, include the full path to the commands to compile the program. - Run the program:
./hello
The expected result is that "Hello World!" is displayed on the screen.
- Check the exit code of the program:
echo $?
The result is zero.