1

Context

As the title suggest, I am trying to compile all .c files in a specific directory.

I am aware from this post that in Linux environment, you can use globbing and do gcc -o executable *.c. However, I am trying to do exactly the same, on a Windows environment.

Question

How can I compile all .c files in a specific/current directory using Cygwin's gcc command on a Windows 10 environment.

Additional Notes

  • Operating System: Windows 10 (x64)
  • Runtime Environment: Cygwin

Edit #1

Per @matzeri's suggestion, I found out that globbing (*.c via the Cygwin termninal) works, however, I need to be able to do it via the terminal.

Programer Beginner
  • 1,377
  • 6
  • 21
  • 47
  • have you tried the same from the cygwin terminal ? Any problem ? – matzeri Feb 21 '21 at 14:16
  • @matzeri using the cygwin terminal works. However, for convinience (and for VS code setting) I would need to be able to perform it through the Window's terminal. – Programer Beginner Feb 21 '21 at 15:14
  • If you plan to use the Cygwin compiler it is easier to use the Cygwin terminal and shell. If you are planning to compile a lot of different files, probably is better to learn and use `Make` – matzeri Feb 21 '21 at 16:33
  • @matzeri good suggestion. For now, I am using `make`, though I wonder if there is a solution for my original question which is _globbing .c files via window's terminal_. – Programer Beginner Feb 21 '21 at 17:43

0 Answers0