Why does my GCC compiler not compile C code?

I followed a YouTube tutorial for installing the gcc compiler on my Windows 10 machine. The install appeared to go perfectly. tutorial here.

I then wrote a C program, which compiles and executes when I check it using online compilers. However, when I run my command prompt and navigate to the directory with my file gcc_test.c and type gcc gcc_test.c nothin changes in the directory. I don't see a .tds or .exe file like I did with my previous compiler so there is no gcc_test.exe file for me to run.

I was sure to add the bin folder to my PATH so I don't understand why the command gcc does nothing. Does anyone know why it does not compile?

1 Answer

Traditionally, gcc always names the executable "a.out" unless told otherwise.

You should use:

gcc -o gcc_test.exe gcc_test.c

You can probably also use:

make gcc_test
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like