How to compile several .c to .o and finaly all .o link to executable? #361
Answered
by
davidgiven
y-salnikov
asked this question in
Q&A
-
|
What is correct way to build executable from more than one C files or from single file with intermediate .o file? |
Beta Was this translation helpful? Give feedback.
Answered by
davidgiven
Mar 23, 2026
Replies: 1 comment 1 reply
-
|
That's a bit weird, but I think is WAI? You need to tell the linker you're building a C program so it can include the C runtime, with the |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
y-salnikov
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That's a bit weird, but I think is WAI? You need to tell the linker you're building a C program so it can include the C runtime, with the
-.cflag. It might be a good idea to make that the default, but this might confuse other things. The logic's a bit complex. It would probably be worth a warning if you don't supply a runtime system and none can be inferred from the file extension.