2

I originally had this in my makefile:

all:
    gcc myFunctions1.h myFunctions1.c myFunctions2.h myFunctions2.c main.c -o main

which worked for some reason until I restarted the terminal. Now I get this error:

clang: error: cannot specify -o when generating multiple output files

So what's the proper way to do this?

1 Answer 1

5

You don't specify header files when compiling. You don't need to as they are included in the source files, and can't be used by themselves.

You might also want to learn about translation units, and how they relate to source and header files.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.