I'm reading a book on C and it's telling me how to use gcc and about the -c option/flag. It reads "-c Compiles to an object (.o) file instead of an executable. This is important for creating library files." What is an object file and how is this good for library files? I'm assuming this is for creating files that don't have a main function and are used only as a resource for other programs. Is my understanding correct? If so could someone give me a 2 very simple(hello world simple) code examples of a program that uses a custom object or library file. Thanks.
Jump to Post
A simple static library is a bunch of ".o" files, stuck together. You need to read Mike's overview:
All 2 Replies
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.