mercredi 22 avril 2015

Cygwin gcc.4.9.2 : error: '::lrintl' has not been declared

This question is related to this thread: cygwin support for C++11 in g++4.9.2

I had the same issue:

error: ‘log2’ is not a member of ‘std’

I applied the proposed patch, only to get another error. Including cmath here

#include <cmath>
#include <iostream>
int main()
{
        std::cout << "hello" << std::endl;
}

returns this error

$ g++ -std=c++11 test.cpp
In file included from test.cpp:1:0:
/usr/lib/gcc/x86_64-pc-cygwin/4.9.2/include/c++/cmath:1107:11: error: '::lrintl' has not been declared
   using ::lrintl;
           ^
/usr/lib/gcc/x86_64-pc-cygwin/4.9.2/include/c++/cmath:1129:11: error: '::rintl' has not been declared
   using ::rintl;

I asked for help on the cygwin IRC channel:

[23:02] <XXX> hi, has anyone had problems with gcc 4.9.2 in cygwin? i encountered the problem discussed here : http://ift.tt/1K5Zt5f
[23:03] <XXX> yet, if i apply the patch, i get another error: /usr/lib/gcc/x86_64-pc-cygwin/4.9.2/include/c++/cmath:1107:11: error: '::lrintl' has not been declared
[23:28] <YYY> long double functions are still missing on cygwin
[23:30] <XXX> so is there no way to make it work then?
[23:31] <YYY> sure, help add the missing functions to newlib/cygwin
[23:34] <XXX> i am not using any long double functions in my code -- so i assume including cmath does not work for anybody?
[23:35] <YYY> just drop the std:: instead
[23:37] <XXX> sorry, i'm not sure what you mean. remove 'std::' where ?

Sadly, the conversation ended there. I have no clue where I should 'drop std::' nor if that resolves the problem. Can anyone help with this?

Thanks in advance, Gunnar

Aucun commentaire:

Enregistrer un commentaire