문제

When I intuitively try to run such command

cc -c source.c header.h -o a_name_different_than_source.o

the following error is thrown

cc: cannot specify -o with -c, -S or -E with multiple files

도움이 되었습니까?

해결책

Do not put header.h in your command line:

cc -c source.c -o a_name_different_than_source.o

will work.

다른 팁

A .c file does not require you to mention the headers on the command line, GCC takes care of that.

A simple gcc inputFilename -o outfileName should suffice.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top