Summary: | std::atanh doesn't exist in glibc | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Samuele Kaplun <Samuele.Kaplun> |
Component: | [OLD] Core system | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED INVALID | ||
Severity: | normal | CC: | truedfx |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | A testcase |
Description
Samuele Kaplun
2006-02-06 02:00:30 UTC
It's there, just don't forget to link with -l m, as documented in the manpage. The fact that sin/cos/... sometimes work without it is because gcc handles them internally, so that the glibc versions aren't needed (but even then, you really still should be linking with -l m). If that doesn't work for you, it'd probably help if you provide a short test program, what you tried to compile it, and the error messages. Created attachment 79015 [details]
A testcase
If I use "using namespace std;" it compiles, else here are the error message from "g++ -o test test.cpp -lm":
test.cpp: In function `int main(int, char**)':
test.cpp:6: error: `atanh' is not a member of `std'
Where I'm wrong?
Sorry, misunderstood the problem. glibc is the C library. libstdc++ is the C++ library, even if it uses the C library to do some of its work. So this is a libstdc++ issue, not a glibc one. Anyway, then the issue is much simpler: std::atanh doesn't exist because it is not a standard C++ function. atanh (::atanh) is a standard C function (and a POSIX function), and because the libstdc++ headers use the glibc headers, it happens to be made available even though it probably shouldn't be. Wow! Thank you. That worked. Sorry for this mistake, and for making you loosing your time... |