Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: ‘trunc’ is not a member of ‘std’ #86

Open
ksdhans opened this issue May 15, 2020 · 3 comments
Open

error: ‘trunc’ is not a member of ‘std’ #86

ksdhans opened this issue May 15, 2020 · 3 comments

Comments

@ksdhans
Copy link
Contributor

ksdhans commented May 15, 2020

Attempting to use std::trunc() results in:
error: ‘trunc’ is not a member of ‘std’

According to the C++11 spec, it should be set in cmath. I tried defining _GLIBCXX_USE_C99_MATH_TR1 in config++.h, but that resulted in a heap of errors such as:
error: ‘::acoshl’ has not been declared

Acoshl and the others are missing from newlib (haven't checked clib2). They're part of the C99 spec.

@sba1
Copy link
Owner

sba1 commented May 23, 2020

Generally, it would help a lot if for all known problems, a simple test source code is provided that can be added in the test folder, even if the problem looks simple.

@ksdhans
Copy link
Contributor Author

ksdhans commented May 25, 2020

Sure:

`#include

int main(int argc, const char **argv) {
double valF = 2.4;
int val = std::trunc(valF);
printf("valF: %f, trunc(valF) = %d\n", valF, val);
return 0;
}`

This is part of the C++11 standard, so you'll need to set --std=c++11 or similar.

@kas1e
Copy link

kas1e commented Feb 2, 2021

from newlib's side everything about "not a member of std::" was fixed in the new beta of newlib 53.69 and adtools recompiled with new newlib's headers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants