Quote:
Originally Posted by geekmaster
To link the math library, use:
tccmake myprog -lm
PHP Code:
]# cat hello.c
#include <stdio.h>
#include <math.h>
int main(void) {
float x=144;
printf("x=%f, sqrt(x)=%f\n",x,sqrt(x));
return 0;
}
]# tccmake hello -lm
]# ./hello
x=144.000000, sqrt(x)=12.000000
]#
It worked for me. You just did not link in the math library with the "-lm" parameter like I showed above...

|
I just test hello on my kindle
/mnt/us/tcc #tccmake hello -lm
tcc:cannot find -lm
/mnt/us/tcc #tccmake hello
tcc:undefined synbol 'sqrt'
The problem is still there.
I just install tcc v1.5
the result is same.