rttree_reduce - undefined reference to `sqrt'

Hi Greg,

I just tried to copile the latest Head Version and got the following errors:
gcc -I../common -I../rt -L../lib -O2 -Dlinux -D_FILE_OFFSET_BITS=64
-L/usr/X11R6/lib -I/usr/include/X11 -DNOSTEREO -o rttree_reduce
rttree_reduce.o -lrtrad
rttree_reduce.o: In function `build_tree':
rttree_reduce.c:(.text+0x4cf): undefined reference to `sqrt'
rttree_reduce.o: In function `trim_tree':
rttree_reduce.c:(.text+0x5d1): undefined reference to `sqrt'
rttree_reduce.o: In function `print_tree':
rttree_reduce.c:(.text+0x784): undefined reference to `sqrt'

Linking the math lib fixes the problem:
in /util/Rmakefile, line 110/111

rttree_reduce: rttree_reduce.o
    $(CC) $(CFLAGS) -o rttree_reduce rttree_reduce.o -lrtrad $(MLIB)

Cheers,
David

Thanks, David. On OS X, the GNU compiler automatically links to libm.a, so I sometimes miss that one....

Cheers,
-Greg

···

From: David Geisler-Moroder <[email protected]>
Date: June 9, 2011 12:38:51 AM PDT

Hi Greg,

I just tried to copile the latest Head Version and got the following errors:
gcc -I../common -I../rt -L../lib -O2 -Dlinux -D_FILE_OFFSET_BITS=64 -L/usr/X11R6/lib -I/usr/include/X11 -DNOSTEREO -o rttree_reduce rttree_reduce.o -lrtrad
rttree_reduce.o: In function `build_tree':
rttree_reduce.c:(.text+0x4cf): undefined reference to `sqrt'
rttree_reduce.o: In function `trim_tree':
rttree_reduce.c:(.text+0x5d1): undefined reference to `sqrt'
rttree_reduce.o: In function `print_tree':
rttree_reduce.c:(.text+0x784): undefined reference to `sqrt'

Linking the math lib fixes the problem:
in /util/Rmakefile, line 110/111

rttree_reduce: rttree_reduce.o
    $(CC) $(CFLAGS) -o rttree_reduce rttree_reduce.o -lrtrad $(MLIB)

Cheers,
David