zig
zig copied to clipboard
zig cc -c can only handle one file argument
zig cc -c handles only one file argument.
gcc and clang both compile and generate object files for each respective file argument given.
also note that zig cc -c handles multiple file arguments differently depending on platform. i.e. on Linux it will only compile the first argument given. On Mac it returns the following type of error message
error: macho does not support linking multiple objects into one
Example gcc run
$ gcc -c c1.c c2.c
$ ls
c1.c c1.o c2.c c2.o
Example zig cc run
$ zig cc -c c1.c c2.c
$ ls
c1.c c1.o c2.c
same problem here
Note: This can sometimes surface in e.g. CMake projects if spurious flags like /EHsc /guard:cf end up on the zig cxx command line by accident.