I've been having a problem with compiling.

I used the following test C code below and saved it as test.c in Home folder.

#include <stdio.h>
int main()
  return 0;

When I run in terminal the code

 gcc test.c -o test

I get nothing. Thank you

  • Did you run ./test?
    – muru
    Mar 22, 2015 at 13:09

1 Answer 1


You are compiling the code, not running it, the correct procedure is:

  • Create the source file (test.c)
  • Compile it with gcc test.c -o test
  • Run it with ./test

Also you can make a oneliner with these commands:

gcc test.c -o test; ./test

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .