can't link against math.h
Bob Eager
rde at tavi.co.uk
Thu Oct 26 08:47:26 UTC 2017
On Thu, 26 Oct 2017 10:05:00 +0800
blubee blubeeme <gurenchan at gmail.com> wrote:
> I wrote a simple test program to test and see if math.h has the
> function: exp10f
>
> #include <math.h>
>
> 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?
It's not in the C standard (C99 or C11). So why would it be available?
More information about the freebsd-ports
mailing list