Lua 5.0 and FreeBSD 4.1

Dan Nelson dnelson at
Tue Jan 17 07:30:30 PST 2006

In the last episode (Jan 17), Evandro Sestrem said:
> I'm trying compile a project using Lua 5.0 ( in FreePascal
> (2.0.2 [2005/11/17] for i386) in a FreeBSD 4.1.
> The Lua 5.0 is correctly installed.
> It compiles ok, but when it is linking I got these errors:
> /usr/local/lib//liblualib.a(lmathlib.o): In function 'math_sin': lmathlib.o(.text+0x52): undefined reference to 'sin'
> /usr/local/lib//liblualib.a(lmathlib.o): In function 'math_cos': lmathlib.o(.text+0x8e): undefined reference to 'cos'
> /usr/local/lib//liblualib.a(lmathlib.o): In function 'math_tan': lmathlib.o(.text+0xca): undefined reference to 'tan'
> In what version of FreeBSD (or libc) these functions (sin, cos, tan,
> ...) were implemented?

Math functions are in libm.  Add -lm to your link line.

	Dan Nelson
	dnelson at

More information about the freebsd-questions mailing list