silentbicycle/guff

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

Opened this issue · 3 comments

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

I had the same problem and yep this patch worked for me. You could make a pull request

I included a patch file.
I don't see how to create a PR from a patch. But git can apply the patch (git apply file.patch), and we can discuss it here in this issue instead of in a PR...

(The patch file is gzipped because github won't upload files that match /.*patch$/.)

I don't see how to create a PR from a patch

I don't think you can without forking the repo