Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Oct 2017 19:23:32 -0700
From:      Steve Kargl <sgk@troutmask.apl.washington.edu>
To:        blubee blubeeme <gurenchan@gmail.com>
Cc:        FreeBSD Ports <freebsd-ports@freebsd.org>, FreeBSD current <freebsd-current@freebsd.org>
Subject:   Re: can't link against math.h
Message-ID:  <20171026022332.GA2292@troutmask.apl.washington.edu>
In-Reply-To: <CALM2mE=VO3VkS3EdP4GhZRudyxcgJNQwH3vFqBUmdY3Ze3kBwQ@mail.gmail.com>
References:  <CALM2mE=VO3VkS3EdP4GhZRudyxcgJNQwH3vFqBUmdY3Ze3kBwQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <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?

No.  You could answer this question with a simple grep on math.h.

Which C standard specifies exp10f or expf10?

-- 
Steve



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20171026022332.GA2292>