Skip to content

undefined reference to 'sqrt' #25

@unicornmafia

Description

@unicornmafia

I am building on linux. It looks like there is a problem accessing the math libraries.

make --trace
Makefile:24: update target 'getopt.o' due to: getopt.c
cc -c -w getopt.c -o getopt.o
Makefile:24: update target 'gpx.o' due to: gpx.c
cc -c -w gpx.c -o gpx.o
Makefile:24: update target 'gpx-main.o' due to: gpx-main.c
cc -c -w gpx-main.c -o gpx-main.o
Makefile:20: update target 'gpx' due to: getopt.o gpx.o gpx-main.o
cc -lm getopt.o gpx.o gpx-main.o -o gpx
gpx.o: In function `magnitude':
gpx.c:(.text+0x1c4b): undefined reference to `sqrt'
gpx.o: In function `mm_to_steps':
gpx.c:(.text+0x2256): undefined reference to `round'
gpx.c:(.text+0x227d): undefined reference to `round'
gpx.c:(.text+0x22a4): undefined reference to `round'
gpx.c:(.text+0x22f4): undefined reference to `round'
gpx.c:(.text+0x2350): undefined reference to `round'
gpx.o:gpx.c:(.text+0x2390): more undefined references to `round' follow
collect2: error: ld returned 1 exit status
Makefile:20: recipe for target 'gpx' failed
make: *** [gpx] Error 1

here's my version

uname -a
Linux 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions