0

I am using Cygwin for my compiler while coding in Codeblocks IDE. Here is what I did in Cygwin 64:


$ gcc -std=c99
gcc: fatal error: no input files
compilation terminated.

However, it's not working. What is the proper way to do this?

Randy Chen
  • 107
  • 8

1 Answers1

0

To compile a c program in its simplest form to a certain standard, you can use the following command:

gcc -std=c99 -W -Wall main.c -o main
Sercan
  • 4,739
  • 3
  • 17
  • 36
  • thanks! but since I'm using the Codeblocks IDE with the compiler set as Cygwin, how should I specify the standard such that I can just click "run&build" in Codeblocks IDE? – Randy Chen Jan 05 '22 at 22:17
  • Related: [How to specify MinGW64 for codeblocks 17.02 on Windows 10?](https://stackoverflow.com/a/51349548/15032688) – Sercan Jan 05 '22 at 22:18
  • Related: [Code::Blocks - MinGW Installation](https://wiki.codeblocks.org/index.php/MinGW_installation) – Sercan Jan 05 '22 at 22:19
  • To set compiler flag on Code::Blocks IDE: [How to add compiler flags on codeblocks](https://stackoverflow.com/a/33209049/15032688) – Sercan Jan 05 '22 at 22:23