Skip to content

Compiling test_... strips exp() definition before use #5

@JeffAbrahamson

Description

@JeffAbrahamson

In order to avoid missing math functions when linking the test programs, move the LDFLAGS (which notably contains -lm) to the end of the compile line.

cc -o test_guff test_guff.o -lm \
	args.o ascii.o counter.o draw.o fnv.o input.o regression.o scale.o svg.o  test_draw.o test_input.o test_regression.o test_scale.o test_types.o  -std=c99 -g -Wall -pedantic   -O3
/usr/bin/ld: ascii.o: in function `print_header':
/home/jeff/src/guff/ascii.c:63: undefined reference to `exp'
/usr/bin/ld: /home/jeff/src/guff/ascii.c:63: undefined reference to `exp'
/usr/bin/ld: /home/jeff/src/guff/ascii.c:57: undefined reference to `exp'
/usr/bin/ld: /home/jeff/src/guff/ascii.c:57: undefined reference to `exp'
/usr/bin/ld: scale.o: in function `scale_transform':
/home/jeff/src/guff/scale.c:45: undefined reference to `log'
/usr/bin/ld: /home/jeff/src/guff/scale.c:40: undefined reference to `log'
/usr/bin/ld: /home/jeff/src/guff/scale.c:45: undefined reference to `log'
/usr/bin/ld: /home/jeff/src/guff/scale.c:40: undefined reference to `log'
/usr/bin/ld: svg.o: in function `svg_plot':
/home/jeff/src/guff/svg.c:68: undefined reference to `log'
/usr/bin/ld: svg.o: in function `scale_tick':
/home/jeff/src/guff/svg.c:131: undefined reference to `log10'
/usr/bin/ld: /home/jeff/src/guff/svg.c:131: undefined reference to `pow'
/usr/bin/ld: /home/jeff/src/guff/svg.c:131: undefined reference to `log10'
/usr/bin/ld: /home/jeff/src/guff/svg.c:131: undefined reference to `pow'
collect2: error: ld returned 1 exit status
make: *** [Makefile:38: test_guff] Error 1

0001-Fix-compile-instruction-for-test_.patch.gz

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