Why Does My Gcc Compiler Not Compile C Code?

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

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

David Miller
Author

David Miller

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.