antirez / load81

SDL based Lua programming environment for kids similar to Codea
BSD 2-Clause "Simplified" License
649 stars 64 forks source link

compiles only with explicit -lm #1

Closed badboy closed 12 years ago

badboy commented 12 years ago

Compilation fails with an error:

/usr/bin/ld: lua/src/liblua.a(lvm.o): undefined reference to symbol 'floor@@GLIBC_2.2.5'
/usr/bin/ld: note: 'floor@@GLIBC_2.2.5' is defined in DSO /lib/libm.so.6 so try adding it to the linker command line
/lib/libm.so.6: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make: *** [codakido] Error 1

If I explicitly add -lm to the Makefile it works just fine:

diff --git i/Makefile w/Makefile
index b6be8ab..9b08f7a 100644
--- i/Makefile
+++ w/Makefile
@@ -1,7 +1,7 @@
 all: codakido

 codakido: codakido.c lua/src/liblua.a
-   $(CC) -O2 -Wall -W $< `sdl-config --cflags` `sdl-config --libs` lua/src/liblua.a -o $@
+   $(CC) -O2 -Wall -W -lm $< `sdl-config --cflags` `sdl-config --libs` lua/src/liblua.a -o $@

 lua/src/liblua.a:
    -(cd lua && $(MAKE) ansi)
antirez commented 12 years ago

Fixed, thank you!