Re: can't link against math.h
% man 3 exp | NAME | exp, expf, expl, exp2, exp2f, exp2l, expm1, expm1f, expm1l, pow, powf, | powl - exponential and power functions gives a good summary as well. Dan Steve Kargl writes: > On Thu, Oct 26, 2017 at 10:05:00AM +0800, blubee blubeeme wrote: >> I wrote a simple test program to test and see if math.h has the function: >> exp10f >> #include >> >> int main(int argc, char** argv) >> { >> (void)argv; >> return ((int*)(&exp10))[argc]; >> } >> >> tried compiling it with clang: >> clang++ test.cpp -o test -lm >> test.cpp:7:17: error: use of undeclared identifier 'expf10' >> return ((int*)(&expf10))[argc]; >> ^ >> 1 error generated. >> >> tried with gcc: >> gcc test.cpp -o test -lm >> test.cpp: In function 'int main(int, char**)': >> test.cpp:7:17: error: 'expf10' was not declared in this scope >> return ((int*)(&expf10))[argc]; >> >> Does FreeBSD math.h have expf10 and if so, how do I link against it? > > No. You could answer this question with a simple grep on math.h. > > Which C standard specifies exp10f or expf10? ___ freebsd-current@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: can't link against math.h
On Thu, Oct 26, 2017 at 10:05:00AM +0800, blubee blubeeme wrote: > I wrote a simple test program to test and see if math.h has the function: > exp10f > #include > > int main(int argc, char** argv) > { > (void)argv; > return ((int*)(&exp10))[argc]; > } > > tried compiling it with clang: > clang++ test.cpp -o test -lm > test.cpp:7:17: error: use of undeclared identifier 'expf10' > return ((int*)(&expf10))[argc]; > ^ > 1 error generated. > > tried with gcc: > gcc test.cpp -o test -lm > test.cpp: In function 'int main(int, char**)': > test.cpp:7:17: error: 'expf10' was not declared in this scope > return ((int*)(&expf10))[argc]; > > Does FreeBSD math.h have expf10 and if so, how do I link against it? No. You could answer this question with a simple grep on math.h. Which C standard specifies exp10f or expf10? -- Steve ___ freebsd-current@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
can't link against math.h
I wrote a simple test program to test and see if math.h has the function: exp10f #include int main(int argc, char** argv) { (void)argv; return ((int*)(&exp10))[argc]; } tried compiling it with clang: clang++ test.cpp -o test -lm test.cpp:7:17: error: use of undeclared identifier 'expf10' return ((int*)(&expf10))[argc]; ^ 1 error generated. tried with gcc: gcc test.cpp -o test -lm test.cpp: In function 'int main(int, char**)': test.cpp:7:17: error: 'expf10' was not declared in this scope return ((int*)(&expf10))[argc]; Does FreeBSD math.h have expf10 and if so, how do I link against it? ___ freebsd-current@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"