I am working under Ubuntu 11.04 and now engaged in a project whose source code uses routines like "sqrtf" or "lgamma", which are complained by my IDE, claiming that they cannot be found in "math.h". A senior member told me I need POSIX.1-2001. I used ldd --version
to check my glibc's version and it gave ldd (Ubuntu EGLIBC 2.13-0ubuntu13) 2.13
. I guessed the embedded version of glibc is simplified so I decided to make it upgraded to the full glibc-2.14. But after some search in aptitude I found that I have to do a manual installation. Getting frustrated all the way, I realize maybe the God is warning me off the wrong path. So...can anyone give some hints for me? Thank you~
Asked
Active
Viewed 2,392 times
6

Ziyuan
- 4,215
- 6
- 48
- 77
-
1I wrote `cout<
– Ziyuan Jul 30 '11 at 07:34 -
Could you write a small testcase? It seems that you are also writing it in c++ ? – plaes Jul 30 '11 at 07:42
-
`#include
#include – Ziyuan Jul 30 '11 at 09:10using namespace std; int main() { cout<
2 Answers
1
Is the linker called with argument -lm?

David
- 165
- 1
- 7
-
1My tentative program as above runs normally after compiled, ignoring Eclipse's complaint, so it may be a bug of Eclipse CDT. – Ziyuan Aug 01 '11 at 09:11
1
As the comment pointed out, it was a bug of CDT.

Ziyuan
- 4,215
- 6
- 48
- 77
-
would you care to link to the bug report and/or resolution? I have the same problem. – Christoph Mar 19 '12 at 16:10
-
-
@krico: Check your indexer settings. See this answer for details: http://stackoverflow.com/questions/10095295/why-cant-codan-find-size-t/10095683#10095683 – HighCommander4 Apr 10 '12 at 21:25
-
can you tell exactly what you did? I have my settings as recommended in that answer, but still float math functions (atanf for example) are not recognized...:-( – Christoph Apr 19 '12 at 20:17
-
To above users and @Christoph: as I recall, I didn't do anything for it and simply switched to another IDE because I thought it was a bug of CDT which was beyond my reach. – Ziyuan Jun 02 '13 at 21:49