g++-4.7

Nested class member access on C++11

会有一股神秘感。 提交于 2019-11-28 02:26:19
问题 In C++11, I am trying to access a member variable of an enclosing class from a nested class in the following way: struct Enclosing { int a; struct Nested { int f() { return a; } }; }; Even this doesn't compile using g++4.7.2 with -std=c++11, producing error messages of this form: error: invalid use of non-static data member 'Enclosing::a' As far as I understand, C++11 treats a nested class as a member of the class, so that supposedly a nested class can access every other member of the

Error “'fdopen' was not declared” found with g++ 4 that compiled with g++3

喜你入骨 提交于 2019-11-28 00:19:16
I have code that compiled happily with g++ version 3.something. I then wanted to build some other code that had C++11 symbols in it so I upgraded to g++ 4.7. Now my original code doesn't build. I get the error: 'fdopen' was not declared in this scope According to the man page, fdopen() is declared in stdio.h which I am including. I'm not sure it is relevant, but I am working in a Cygwin environment. The exact version of g++ I am using is version 4.7.2 provided by Cygwin. I have not changed this code since I switched compiler and I can definitely confirm that it built and my test code ran and

Error “'fdopen' was not declared” found with g++ 4 that compiled with g++3

孤者浪人 提交于 2019-11-26 21:40:08
问题 I have code that compiled happily with g++ version 3.something. I then wanted to build some other code that had C++11 symbols in it so I upgraded to g++ 4.7. Now my original code doesn't build. I get the error: 'fdopen' was not declared in this scope According to the man page, fdopen() is declared in stdio.h which I am including. I'm not sure it is relevant, but I am working in a Cygwin environment. The exact version of g++ I am using is version 4.7.2 provided by Cygwin. I have not changed