Testing the installation

To test the product installation and the critical search paths, try building, compiling, and running a simple program.

For example:

  1. Create the following C program:
    [hello.c]
    #include <stdio.h>
    int main(void)
    {
       printf("Hello World!\n");
       return 0;
    }
  2. 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.
  3. Run the program:
    ./hello

    The expected result is that "Hello World!" is displayed on the screen.

  4. Check the exit code of the program:
    echo $?

    The result is zero.



Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us