I have downloaded clang. When I got onto terminal and type clang it results in the error no input files.
1 Answer
The clang: error: no input files error in your question means exactly what it says. You need to specify an input file after typing clang in the terminal in order to tell clang what code to run.
This example uses the clang package from the default Ubuntu repositories (clang-3.8) and the following source code for hello.c.
#include <stdio.h>
int main(int argc, char **argv) { printf("hello world\n");
}Change directories using cd to the directory containing hello.c (the input file) and compile it using the following command:
clang hello.cThe compiled executable file will be named a.out. Run it using the following command:
./a.outThe results of ./a.out are:
hello world