Date: Thu, 26 Oct 2017 16:49:45 +0800 From: blubee blubeeme <gurenchan@gmail.com> To: Bob Eager <rde@tavi.co.uk> Cc: FreeBSD Ports <freebsd-ports@freebsd.org> Subject: Re: can't link against math.h Message-ID: <CALM2mEm8DwJvubLvuqYYgA0saPB0f7a2wXY4TJoanm0pPjAgNw@mail.gmail.com> In-Reply-To: <20171026094155.39fb5f14@raksha.tavi.co.uk> References: <CALM2mE=VO3VkS3EdP4GhZRudyxcgJNQwH3vFqBUmdY3Ze3kBwQ@mail.gmail.com> <20171026094155.39fb5f14@raksha.tavi.co.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
Thanks for the tips I didn't know that it wasn't in the std c library and was GNU specific code. I think I'll take Montgomery-Smith advice and implement it as this: #define exp10f(x) (powf(10.,x)) Porting software is some interesting work. On Thu, Oct 26, 2017 at 4:41 PM, Bob Eager <rde@tavi.co.uk> wrote: > On Thu, 26 Oct 2017 10:05:00 +0800 > blubee blubeeme <gurenchan@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? > _______________________________________________ > freebsd-ports@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-ports > To unsubscribe, send any mail to "freebsd-ports-unsubscribe@freebsd.org" >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALM2mEm8DwJvubLvuqYYgA0saPB0f7a2wXY4TJoanm0pPjAgNw>