I assume you are using gcc
, to simply link object files do:
$ gcc -o output file1.o file2.o
To get the object-files simply compile using
$ gcc -c file1.c
this yields file1.o and so on.
If you want to link your files to an executable do
$ gcc -o output file1.c file2.c
More Related Contents:
- Given the state of the stack and registers, can we predict the outcome of printf’s undefined behavior
- Is there a way to use gcc to convert C to MIPS?
- What is -ffreestanding option in gcc?
- Why we need Clobbered registers list in Inline Assembly?
- Removing trailing newline character from fgets() input
- C undefined behavior. Strict aliasing rule, or incorrect alignment? [duplicate]
- Undefined reference to `pow’ and `floor’
- Adding leading underscores to assembly symbols with GCC on Win32?
- What is the difference between C, C99, ANSI C and GNU C?
- aligned malloc() in GCC?
- Why didn’t gcc (or glibc) implement _s functions?
- How to access C variable for inline assembly manipulation?
- How to check if a given file descriptor stored in a variable is still valid?
- Detecting 64bit compile in C
- How to link to a static library in C?
- How to make gcc link strong symbol in static library to overwrite weak symbol?
- C function defined as int but having no return statement in the body still compiles
- How do header and source files in C work?
- multi-word addition using the carry flag
- Inline assembly that clobbers the red zone
- GCC 4.7 Source Character Encoding and Execution Character Encoding For String Literals?
- Compiler changes printf to puts
- How to tell GCC to generate 16-bit code for real mode
- How to get the size of a C function from inside a C program or with inline assembly?
- Why is execstack required to execute code on the heap?
- gcc detect duplicate symbols/functions in static libraries
- GCC – no warning about an uninitialized array with -O0
- Order of fields when using a bit field in C
- How much overhead can the -fPIC flag add?
- conflicting types error when compiling c program using gcc