pow is a stdlib function, but to use it you should link the stdlib itself (math lib).

Usually gcc does it automatically, but try adding -lm link flag:

gcc -lm Update.o ScanData.o <..the rest of object files..>

Also make sure that libc is present in system (on debian/ubuntu - dpkg -s libc6-dev should tell that it is installed)

Not directly related to question: does main.o really depend on all the sources? it only builds from main.c

Answer from Vasfed on Stack Overflow
🌐
GitHub
github.com › anotheremily › bin2txt › issues › 1
make fail, undefined reference to `pow', math lib problem · Issue #1 · anotheremily/bin2txt
December 23, 2017 - Make error message: make gcc -c driver.c gcc -c convert.c gcc -lm -o bin2txt driver.o convert.o convert.o: In function `bin2txt': convert.c:(.text+0x70): **undefined reference to `pow'** collect2: error: ld returned 1 exit status makefil...
Author   anarkia7115
People also ask

What Is an Undefined Reference in C Programming Language?
A reference remains undefined in C programming language when a reference to a relocatable object (function, class, variable, etc) does find its definition even after searching all the object files. Also, when you use a shared object to build a dynamic application but you leave an unresolved reference definition.
🌐
positioniseverything.net
positioniseverything.net › home › undefined reference to `pow’: fixing the error
Undefined Reference to `Pow’: Fixing the Error - Position Is ...
What Types of Data Does Pow() Return?
The pow() function will return the base value to the exponent. Both the base value and the power or exponent are in decimal values. This is because the pow() function accepts float, double, and int. It is important to note that function does not always work with integers.
🌐
positioniseverything.net
positioniseverything.net › home › undefined reference to `pow’: fixing the error
Undefined Reference to `Pow’: Fixing the Error - Position Is ...
🌐
Electro Tech Online
electro-tech-online.com › members area › members lounge › computers and networks
Gnu c math.h pow bug | Electronics Forum (Circuits, Projects and Microcontrollers)
October 11, 2013 - lepo@ubulap:~/DeitelC/Ch04$ make cc fig04_06.c -o fig04_06 /tmp/ccs1glMa.o: In function `main': fig04_06.c:(.text+0x87): undefined reference to `pow' collect2: ld returned 1 exit status make: *** [fig04_06] Error 1 lepo@ubulap:~/DeitelC/Ch04$ You know everybody is ignorant, only on different subjects. - Will Rogers (1879 - 1935) ... Maybe the problem is that you are trying to use Makefile as a script.
🌐
GeeksforGeeks
geeksforgeeks.org › c language › how-to-solve-undefined-reference-to-pow-in-c-language
How to solve undefined reference to `pow' in C language? - GeeksforGeeks
July 23, 2025 - The math library (libm) contains ... others. If you do not explicitly link this library during the compilation, the linker will not be able to find the definition of pow, resulting in an "undefined reference" error...
🌐
Position Is Everything
positioniseverything.net › home › undefined reference to `pow’: fixing the error
Undefined Reference to `Pow’: Fixing the Error - Position Is Everything
November 11, 2025 - The reason you are getting the undefined reference to pow’ makefile error is that your program is unable to find the definition of pow().
Find elsewhere
🌐
Arch Linux Forums
bbs.archlinux.org › viewtopic.php
[SOLVED] Issues with Include in C / Programming & Scripting / Arch Linux Forums
My crystal ball says you're not linking in the necessary libraries, which would result in a message like "undefined reference to `pow' " (or whatever function you're trying to use). The functions declared in <stdio.h> are in libc.a, which is linked in by default; most of what's in <math.h> is in libm.a, which is not.
🌐
IncludeHelp
includehelp.com › c-programming-questions › error-undefined-reference-to-pow-in-linux.aspx
Error - undefined reference to 'pow' with C program in GCC Linux
C - Call by Reference Vs. Call by Value ... C Vs. Embedded C ... C - Copy Two Bytes Int. to Byte Buffer ... This is a common error while compiling C program in GCC/G++ Linux. This error occurs when you are using pow function to calculate power of a number in your programs.
🌐
GitHub
github.com › bitly › dablooms › issues › 70
undefined reference to `log`, `ceil`, `pow` · Issue #70 · bitly/dablooms
December 30, 2016 - $ make test CC build/test_dablooms.o ... function `new_counting_bloom_from_scale': /work/dablooms/src/dablooms.c:327: undefined reference to `pow' collect2: error: ld returned 1 exit status Makefile:124: recipe for target 'build/test_dablooms' failed make: *** [build/test_dablooms] ...
Author   rubensayshi
🌐
Cprogramming
cboard.cprogramming.com › c-programming › 123684-undefined-reference-`pow.html
: undefined reference to `pow'
Q1. Because of the default prototype presumed by the compiler for "pow()". It's a bad idea to not include the prototype. See the C89 standard for more information. Q2. Probably left over object files and linkage. Delete all the generated files (including ones in tmp) then you'll most likely get the error again.
Top answer
1 of 1
2

The problem here is the order you link with the math library (the -lm option). Libraries should be after the sources or object files on the command line when building.

So if you ran the command to build manually, it should look like

gcc p1.c -o p1 -lm

The problem is that your makefile doesn't really do anything, and it lives on implicit rules alone. The implicit rules use certain variables in a certain order which do not place the library in the right position in your makefile.

Try instead something like this makefile:

# The C compiler to use.
CC = gcc

# The C compiler flags to use.
# The -g flag is for adding debug information.
# The -Wall flag is to enable more warnings from the compiler
CFLAGS = -g -Wall

# The linker flags to use, none is okay.
LDFLAGS = 

# The libraries to link with.
LDLIBS = -lm

# Define the name of the executable you want to build.
EXEC = p1

# List the object files needed to create the executable above.
OBJECTS = p1.o

# Since this is the first rule, it's also the default rule to make
# when no target is specified. It depends only on the executable
# being built.
all: $(EXEC)

# This rule tells make that the executable being built depends on
# certain object files. This will link using $(LDFLAGS) and $(LDLIBS).
$(EXEC): $(OBJECTS)

# No rule needed for the object files. The implicit rules used
# make together with the variable defined above will make sure
# they are built with the expected flags.

# Target to clean up. Removes the executable and object files.
# This target is not really necessary but is common, and can be
# useful if special handling is needed or there are many targets
# to clean up.
clean:
    -rm -f *.o $(EXEC)

If you run make using the above makefile, the make program should first build the object file p1.o from the source file p1.c. Then is should use the p1.o object file to link the executable p1 together with the standard math library.

🌐
CopyProgramming
copyprogramming.com › howto › undefined-reference-to-pow
Makefile: Error message 'pow' has no defined reference
April 16, 2023 - clang-9 -lm test.c -ffast-math /usr/bin/ld: /tmp/test-9b1a45.o: in function `main': test.c:(.text+0x2a): undefined reference to `__pow_finite' readelf -Ws /lib/x86_64-linux-gnu/libm.so.6| grep pow_finite 626: 000000000002ed90 65 IFUNC GLOBAL DEFAULT 17 __pow_finite@GLIBC_2.15
🌐
Its Linux FOSS
itslinuxfoss.com › home › how to fix the “undefined reference to ‘pow’” error
How to fix the “undefined reference to ‘pow’” error – Its Linux FOSS
July 22, 2022 - The error “undefined reference to 'pow'” can occur due to the absence of the header file or due to incorrect compilation.