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
Related Contents:
- Determining C executable name
- What is -ffreestanding option in gcc?
- How are char arrays / strings stored in binary files?
- Removing trailing newline character from fgets() input
- Using GCC to produce readable assembly?
- Why does GCC use multiplication by a strange number in implementing integer division?
- Is errno thread-safe?
- Warning/error “function declaration isn’t a prototype”
- What is the use of _start() in C?
- Bubble sort slower with -O3 than -O2 with GCC
- Why is a simple loop optimized when the limit is 959 but not 960?
- How many GCC optimization levels are there?
- How do I fix “for loop initial declaration used outside C99 mode” GCC error?
- Is gcc C compiler written in C itself?
- Trying to understand gcc option -fomit-frame-pointer
- The difference between asm, asm volatile and clobbering memory
- Why is the compiler throwing this warning: “missing initializer”? Isn’t the structure initialized?
- Why does GCC pad functions with NOPs?
- How to turn off gcc compiler optimization to enable buffer overflow
- What is C17 and what changes have been made to the language?
- What is the default C -std standard version for the current GCC (especially on Ubuntu)?
- How to compile executable for Windows with GCC with Linux Subsystem?
- Is there a 128 bit integer in gcc?
- Floating point exception ( SIGFPE ) on ‘int main(){ return(0); }’
- Printf long long int in C with GCC?
- How does this C program compile and run with two main functions?
- How to add a builtin function in a GCC plugin?
- how to print __uint128_t number using gcc?
- Anonymous functions using GCC statement expressions
- What is “!!” in C? [duplicate]
- GCC’s assembly output of an empty program on x86, win32
- How to circumvent format-truncation warning in GCC?
- Anonymous union within struct not in c99?
- Maximum size of size_t
- What is the difference between str==NULL and str[0]==’\0′ in C?
- What causes a char to be signed or unsigned when using gcc?
- Why does GCC create a shared object instead of an executable binary according to file?
- How do I execute a file in Cygwin?
- What is “…” in switch-case in C code
- difference between and
- C preprocessor: expand macro in a #warning
- Stack allocation, padding, and alignment
- Reading a register value into a C variable [duplicate]
- Is it a good idea to compile a language to C?
- Query on -ffunction-section & -fdata-sections options of gcc
- use RPATH but not RUNPATH?
- Expressions “j = ++(i | i); and j = ++(i & i); should be a lvalue error?
- Location of C standard library
- Detecting 64bit compile in C
- Why does passing char** as const char** generate a warning?