Compile all .c files in a directory using the GCC compiler in CMD

Is there a way to compile all the files .cin a given folder using the command line with the GCC compiler?
I saw this page for Linux: http://www.commandlinefu.com/commands/view/3230/compile-all-c-files-in-a-directory , but could not find the equivalent for CMD.

+4
source share
2 answers

I think gcc itself does not have such a parameter.

But you can try the usual substitution argument gcc *.c -o Output, where *(wildcard) should read like "any."

+11
source

:

gcc -c -Wall file1.c file2.c file3.c

. -Wall .

, .

+1

All Articles