You need to compile with the link flag -lm
, like this:
gcc fib.c -lm -o fibo
This will tell gcc to link your code against the math lib. Just be sure to put the flag after the objects you want to link.
More Related Contents:
- How come when I try to compile my C program by making a file named for the program it creates an application for it?
- Can’t compile C program on a Mac after upgrade to Mojave
- Is there a 128 bit integer in gcc?
- Can I use Intel syntax of x86 assembly with GCC?
- Scanf skips every other while loop in C
- Disable all optimization options in GCC
- Is errno thread-safe?
- Syscall implementation of exit()
- What is the meaning of “__attribute__((packed, aligned(4))) “
- Embedding binary blobs using gcc mingw
- Why does GCC pad functions with NOPs?
- Tell gcc to specifically unroll a loop
- gcc: undefined reference to
- Can I mix static and shared-object libraries when linking?
- Why can’t local variable be used in GNU C basic inline asm statements?
- Installing OpenMP on Mac OS X 10.11
- Fused multiply add and default rounding modes
- Yet Another MinGW “gcc: error: CreateProcess: No such file or directory”
- Why do I get a warning every time I use malloc?
- An alternative for the deprecated __malloc_hook functionality of glibc
- Implementation of sizeof operator
- Standard C library in mingW
- Pointer arithmetic when void has unknown size [closed]
- How to compile executable for Windows with GCC with Linux Subsystem?
- 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 – no warning about an uninitialized array with -O0
- Order of fields when using a bit field in C
- conflicting types error when compiling c program using gcc