PacktPublishing / Linux-System-Programming-Techniques

Linux System Programming Techniques, published by Packt
MIT License
96 stars 44 forks source link

ch4: compile error ubuntu20 #4

Closed Hedvre closed 1 year ago

Hedvre commented 1 year ago

Hi, thanks for this excellent book! regarding the compilation of "huge-test.c" program in chapter 4 I add this error when launching compilation $ gcc -Wall -Wextra -pedantic huge-test.c -o huge-test /usr/bin/ld: /tmp/ccSn74Ix.o: in function main': huge-test.c:(.text+0x1e): undefined reference topow' collect2: error: ld returned 1 exit status

Linking against math lib using -lm worked: $ gcc -Wall -Wextra -pedantic huge-test.c -lm -o huge-test My OS is ubuntu 20 (up to date)

Hedvre commented 1 year ago

Sorry haven't seen the end of the page where it was indicated (was not displayed properly). Thanks again for your book