Re: [Vala] Problem using GLib's Math class



On 05/09/07, Mathias Hasselmann <mathias hasselmann gmx de> wrote:
Am Mittwoch, den 05.09.2007, 01:58 -0400 schrieb Michel Salim:
I found this really bizarre problem when compiling a simple test case:
the C file generated by Vala seems to be correct, but I keep getting
linker errors of this sort:

/tmp/cc2bjTjM.o: In function `euclid_gcd':
euclid.c:(.text+0xd4): undefined reference to `floor'
collect2: ld returned 1 exit status
error: cc exited with status 256
Compilation failed: 1 error(s), 0 warning(s)

You'll have to link with -lm to use most of the math functions in a
console based Vala program. We plan support for automatically adding
that compiler switch, but for now you have to compile your program with
the switches "-X -lm". When using GTK+ you can omit that switches, as
GTK+ pulls in that dependency already.

Ah OK. Why does the smaller test example work fine, though?

Thanks,

-- 
Michel



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]