Wolf-Ekkehard
November 1st, 2011, 10:19 PM
I thought I should be able to figure that out by myself, but I am beginning to pull my hair out over this...
I have Kubuntu 11.10 running on two 32-bit x86 machines. On one (a laptop) g++ (4.6.1) works fine. The other one I just converted recently from a dumped Windows box and put 11.10 on it. The latter one won't let me compile. I reduced the problem to the simplest form, i.e. the effects of the include tree of /usr/include/c++/4.6/ios:
#include <ios>
int main( int argc, char** argv )
{
;
}
When I compile on the faulty machine, I get the following output (on the laptop it compiles silently without error and exits):
g++ main.cpp
In file included from /usr/include/c++/4.6/bits/basic_ios.h:39:0,
from /usr/include/c++/4.6/ios:45,
from main.cpp:1:
/usr/include/c++/4.6/bits/locale_facets.h:2530:44: error: macro "isspace" passed 2 arguments, but takes just 1
/usr/include/c++/4.6/bits/locale_facets.h:2536:44: error: macro "isprint" passed 2 arguments, but takes just 1
/usr/include/c++/4.6/bits/locale_facets.h:2542:44: error: macro "iscntrl" passed 2 arguments, but takes just 1
/usr/include/c++/4.6/bits/locale_facets.h:2548:44: error: macro "isupper" passed 2 arguments, but takes just 1
/usr/include/c++/4.6/bits/locale_facets.h:2554:44: error: macro "islower" passed 2 arguments, but takes just 1
/usr/include/c++/4.6/bits/locale_facets.h:2560:44: error: macro "isalpha" passed 2 arguments, but takes just 1
/usr/include/c++/4.6/bits/locale_facets.h:2566:44: error: macro "isdigit" passed 2 arguments, but takes just 1
/usr/include/c++/4.6/bits/locale_facets.h:2572:44: error: macro "ispunct" passed 2 arguments, but takes just 1
/usr/include/c++/4.6/bits/locale_facets.h:2578:45: error: macro "isxdigit" passed 2 arguments, but takes just 1
/usr/include/c++/4.6/bits/locale_facets.h:2584:44: error: macro "isalnum" passed 2 arguments, but takes just 1
/usr/include/c++/4.6/bits/locale_facets.h:2590:44: error: macro "isgraph" passed 2 arguments, but takes just 1
In file included from /usr/include/c++/4.6/cwchar:46:0,
from /usr/include/c++/4.6/bits/postypes.h:42,
from /usr/include/c++/4.6/iosfwd:42,
from /usr/include/c++/4.6/ios:39,
from main.cpp:1:
/usr/include/wchar.h:578:8: error: ‘__FILE’ does not name a type
/usr/include/wchar.h:585:19: error: ‘__FILE’ was not declared in this scope
/usr/include/wchar.h:585:27: error: ‘__fp’ was not declared in this scope
/usr/include/wchar.h:585:33: error: expected primary-expression before ‘int’
/usr/include/wchar.h:585:43: error: expression list treated as compound expression in initializer [-fpermissive]
/usr/include/wchar.h:585:45: error: expected ‘,’ or ‘;’ before ‘throw’
/usr/include/wchar.h:592:22: error: ‘__FILE’ was not declared in this scope
/usr/include/wchar.h:592:30: error: expected primary-expression before ‘__restrict’
/usr/include/wchar.h:593:8: error: expected primary-expression before ‘__const’
/usr/include/wchar.h:593:46: error: expected primary-expression before ‘...’ token
/usr/include/wchar.h:593:49: error: expression list treated as compound expression in initializer [-fpermissive]
/usr/include/wchar.h:610:23: error: ‘__FILE’ was not declared in this scope
/usr/include/wchar.h:610:31: error: expected primary-expression before ‘__restrict’
/usr/include/wchar.h:611:9: error: expected primary-expression before ‘__const’
/usr/include/wchar.h:612:24: error: expected primary-expression before ‘__arg’
/usr/include/wchar.h:612:29: error: expression list treated as compound expression in initializer [-fpermissive]
/usr/include/wchar.h:633:21: error: ‘__FILE’ was not declared in this scope
/usr/include/wchar.h:633:29: error: expected primary-expression before ‘__restrict’
/usr/include/wchar.h:634:7: error: expected primary-expression before ‘__const’
/usr/include/wchar.h:634:45: error: expected primary-expression before ‘...’ token
/usr/include/wchar.h:634:48: error: expression list treated as compound expression in initializer [-fpermissive]
/usr/include/wchar.h:687:22: error: ‘__FILE’ was not declared in this scope
/usr/include/wchar.h:687:30: error: expected primary-expression before ‘__restrict’
/usr/include/wchar.h:688:8: error: expected primary-expression before ‘__const’
/usr/include/wchar.h:689:23: error: expected primary-expression before ‘__arg’
/usr/include/wchar.h:689:28: error: expression list treated as compound expression in initializer [-fpermissive]
/usr/include/wchar.h:743:23: error: ‘__FILE’ was not declared in this scope
/usr/include/wchar.h:743:31: error: ‘__stream’ was not declared in this scope
/usr/include/wchar.h:744:22: error: ‘__FILE’ was not declared in this scope
/usr/include/wchar.h:744:30: error: ‘__stream’ was not declared in this scope
/usr/include/wchar.h:757:37: error: ‘__FILE’ has not been declared
/usr/include/wchar.h:758:36: error: ‘__FILE’ has not been declared
/usr/include/wchar.h:773:4: error: ‘__FILE’ has not been declared
/usr/include/wchar.h:780:6: error: ‘__FILE’ has not been declared
/usr/include/wchar.h:787:37: error: ‘__FILE’ has not been declared
/usr/include/wchar.h:799:31: error: ‘__FILE’ was not declared in this scope
/usr/include/wchar.h:799:39: error: ‘__stream’ was not declared in this scope
/usr/include/wchar.h:808:32: error: ‘__FILE’ was not declared in this scope
/usr/include/wchar.h:808:40: error: ‘__stream’ was not declared in this scope
/usr/include/wchar.h:816:46: error: ‘__FILE’ has not been declared
/usr/include/wchar.h:825:45: error: ‘__FILE’ has not been declared
/usr/include/wchar.h:836:6: error: ‘__FILE’ has not been declared
/usr/include/wchar.h:845:8: error: ‘__FILE’ has not been declared
In file included from /usr/include/c++/4.6/bits/localefwd.h:44:0,
from /usr/include/c++/4.6/ios:42,
from main.cpp:1:
/usr/include/c++/4.6/cctype:66:11: error: ‘::isalnum’ has not been declared
/usr/include/c++/4.6/cctype:67:11: error: ‘::isalpha’ has not been declared
/usr/include/c++/4.6/cctype:68:11: error: ‘::iscntrl’ has not been declared
/usr/include/c++/4.6/cctype:69:11: error: ‘::isdigit’ has not been declared
/usr/include/c++/4.6/cctype:70:11: error: ‘::isgraph’ has not been declared
/usr/include/c++/4.6/cctype:71:11: error: ‘::islower’ has not been declared
/usr/include/c++/4.6/cctype:72:11: error: ‘::isprint’ has not been declared
/usr/include/c++/4.6/cctype:73:11: error: ‘::ispunct’ has not been declared
/usr/include/c++/4.6/cctype:74:11: error: ‘::isspace’ has not been declared
/usr/include/c++/4.6/cctype:75:11: error: ‘::isupper’ has not been declared
/usr/include/c++/4.6/cctype:76:11: error: ‘::isxdigit’ has not been declared
In file included from /usr/include/c++/4.6/bits/locale_facets.h:43:0,
from /usr/include/c++/4.6/bits/basic_ios.h:39,
from /usr/include/c++/4.6/ios:45,
from main.cpp:1:
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:50:35: error: ‘_ISupper’ was not declared in this scope
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:51:32: error: ‘_ISlower’ was not declared in this scope
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:52:32: error: ‘_ISalpha’ was not declared in this scope
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:53:32: error: ‘_ISdigit’ was not declared in this scope
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:54:33: error: ‘_ISxdigit’ was not declared in this scope
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:55:32: error: ‘_ISspace’ was not declared in this scope
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:56:32: error: ‘_ISprint’ was not declared in this scope
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:57:32: error: ‘_ISalpha’ was not declared in this scope
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:57:43: error: ‘_ISdigit’ was not declared in this scope
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:57:54: error: ‘_ISpunct’ was not declared in this scope
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:58:32: error: ‘_IScntrl’ was not declared in this scope
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:59:32: error: ‘_ISpunct’ was not declared in this scope
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:60:32: error: ‘_ISalpha’ was not declared in this scope
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:60:43: error: ‘_ISdigit’ was not declared in this scope
In file included from /usr/include/c++/4.6/bits/basic_ios.h:39:0,
from /usr/include/c++/4.6/ios:45,
from main.cpp:1:
/usr/include/c++/4.6/bits/locale_facets.h:2530:5: error: ‘std::isspace’ declared as an ‘inline’ variable
/usr/include/c++/4.6/bits/locale_facets.h:2530:5: error: template declaration of ‘bool std::isspace’
/usr/include/c++/4.6/bits/locale_facets.h:2531:7: error: expected primary-expression before ‘return’
/usr/include/c++/4.6/bits/locale_facets.h:2531:7: error: expected ‘}’ before ‘return’
/usr/include/c++/4.6/bits/locale_facets.h:2536:5: error: ‘isprint’ declared as an ‘inline’ variable
/usr/include/c++/4.6/bits/locale_facets.h:2536:5: error: template declaration of ‘bool isprint’
/usr/include/c++/4.6/bits/locale_facets.h:2537:7: error: expected primary-expression before ‘return’
/usr/include/c++/4.6/bits/locale_facets.h:2537:7: error: expected ‘}’ before ‘return’
/usr/include/c++/4.6/bits/locale_facets.h:2537:75: error: expected declaration before ‘}’ token
~/LynX10/src/bug
$
I have diff-ed the output of g++ -v as well as the files locale_facets.h, basic_ios.h, and ios from both machines - they are all identical.
Can anybody shed some light on this for me, please?? How did I mess this up, and, more importantly, how do I fix it? I really don't want to turn my ten year old laptop into a compile server.....
I have Kubuntu 11.10 running on two 32-bit x86 machines. On one (a laptop) g++ (4.6.1) works fine. The other one I just converted recently from a dumped Windows box and put 11.10 on it. The latter one won't let me compile. I reduced the problem to the simplest form, i.e. the effects of the include tree of /usr/include/c++/4.6/ios:
#include <ios>
int main( int argc, char** argv )
{
;
}
When I compile on the faulty machine, I get the following output (on the laptop it compiles silently without error and exits):
g++ main.cpp
In file included from /usr/include/c++/4.6/bits/basic_ios.h:39:0,
from /usr/include/c++/4.6/ios:45,
from main.cpp:1:
/usr/include/c++/4.6/bits/locale_facets.h:2530:44: error: macro "isspace" passed 2 arguments, but takes just 1
/usr/include/c++/4.6/bits/locale_facets.h:2536:44: error: macro "isprint" passed 2 arguments, but takes just 1
/usr/include/c++/4.6/bits/locale_facets.h:2542:44: error: macro "iscntrl" passed 2 arguments, but takes just 1
/usr/include/c++/4.6/bits/locale_facets.h:2548:44: error: macro "isupper" passed 2 arguments, but takes just 1
/usr/include/c++/4.6/bits/locale_facets.h:2554:44: error: macro "islower" passed 2 arguments, but takes just 1
/usr/include/c++/4.6/bits/locale_facets.h:2560:44: error: macro "isalpha" passed 2 arguments, but takes just 1
/usr/include/c++/4.6/bits/locale_facets.h:2566:44: error: macro "isdigit" passed 2 arguments, but takes just 1
/usr/include/c++/4.6/bits/locale_facets.h:2572:44: error: macro "ispunct" passed 2 arguments, but takes just 1
/usr/include/c++/4.6/bits/locale_facets.h:2578:45: error: macro "isxdigit" passed 2 arguments, but takes just 1
/usr/include/c++/4.6/bits/locale_facets.h:2584:44: error: macro "isalnum" passed 2 arguments, but takes just 1
/usr/include/c++/4.6/bits/locale_facets.h:2590:44: error: macro "isgraph" passed 2 arguments, but takes just 1
In file included from /usr/include/c++/4.6/cwchar:46:0,
from /usr/include/c++/4.6/bits/postypes.h:42,
from /usr/include/c++/4.6/iosfwd:42,
from /usr/include/c++/4.6/ios:39,
from main.cpp:1:
/usr/include/wchar.h:578:8: error: ‘__FILE’ does not name a type
/usr/include/wchar.h:585:19: error: ‘__FILE’ was not declared in this scope
/usr/include/wchar.h:585:27: error: ‘__fp’ was not declared in this scope
/usr/include/wchar.h:585:33: error: expected primary-expression before ‘int’
/usr/include/wchar.h:585:43: error: expression list treated as compound expression in initializer [-fpermissive]
/usr/include/wchar.h:585:45: error: expected ‘,’ or ‘;’ before ‘throw’
/usr/include/wchar.h:592:22: error: ‘__FILE’ was not declared in this scope
/usr/include/wchar.h:592:30: error: expected primary-expression before ‘__restrict’
/usr/include/wchar.h:593:8: error: expected primary-expression before ‘__const’
/usr/include/wchar.h:593:46: error: expected primary-expression before ‘...’ token
/usr/include/wchar.h:593:49: error: expression list treated as compound expression in initializer [-fpermissive]
/usr/include/wchar.h:610:23: error: ‘__FILE’ was not declared in this scope
/usr/include/wchar.h:610:31: error: expected primary-expression before ‘__restrict’
/usr/include/wchar.h:611:9: error: expected primary-expression before ‘__const’
/usr/include/wchar.h:612:24: error: expected primary-expression before ‘__arg’
/usr/include/wchar.h:612:29: error: expression list treated as compound expression in initializer [-fpermissive]
/usr/include/wchar.h:633:21: error: ‘__FILE’ was not declared in this scope
/usr/include/wchar.h:633:29: error: expected primary-expression before ‘__restrict’
/usr/include/wchar.h:634:7: error: expected primary-expression before ‘__const’
/usr/include/wchar.h:634:45: error: expected primary-expression before ‘...’ token
/usr/include/wchar.h:634:48: error: expression list treated as compound expression in initializer [-fpermissive]
/usr/include/wchar.h:687:22: error: ‘__FILE’ was not declared in this scope
/usr/include/wchar.h:687:30: error: expected primary-expression before ‘__restrict’
/usr/include/wchar.h:688:8: error: expected primary-expression before ‘__const’
/usr/include/wchar.h:689:23: error: expected primary-expression before ‘__arg’
/usr/include/wchar.h:689:28: error: expression list treated as compound expression in initializer [-fpermissive]
/usr/include/wchar.h:743:23: error: ‘__FILE’ was not declared in this scope
/usr/include/wchar.h:743:31: error: ‘__stream’ was not declared in this scope
/usr/include/wchar.h:744:22: error: ‘__FILE’ was not declared in this scope
/usr/include/wchar.h:744:30: error: ‘__stream’ was not declared in this scope
/usr/include/wchar.h:757:37: error: ‘__FILE’ has not been declared
/usr/include/wchar.h:758:36: error: ‘__FILE’ has not been declared
/usr/include/wchar.h:773:4: error: ‘__FILE’ has not been declared
/usr/include/wchar.h:780:6: error: ‘__FILE’ has not been declared
/usr/include/wchar.h:787:37: error: ‘__FILE’ has not been declared
/usr/include/wchar.h:799:31: error: ‘__FILE’ was not declared in this scope
/usr/include/wchar.h:799:39: error: ‘__stream’ was not declared in this scope
/usr/include/wchar.h:808:32: error: ‘__FILE’ was not declared in this scope
/usr/include/wchar.h:808:40: error: ‘__stream’ was not declared in this scope
/usr/include/wchar.h:816:46: error: ‘__FILE’ has not been declared
/usr/include/wchar.h:825:45: error: ‘__FILE’ has not been declared
/usr/include/wchar.h:836:6: error: ‘__FILE’ has not been declared
/usr/include/wchar.h:845:8: error: ‘__FILE’ has not been declared
In file included from /usr/include/c++/4.6/bits/localefwd.h:44:0,
from /usr/include/c++/4.6/ios:42,
from main.cpp:1:
/usr/include/c++/4.6/cctype:66:11: error: ‘::isalnum’ has not been declared
/usr/include/c++/4.6/cctype:67:11: error: ‘::isalpha’ has not been declared
/usr/include/c++/4.6/cctype:68:11: error: ‘::iscntrl’ has not been declared
/usr/include/c++/4.6/cctype:69:11: error: ‘::isdigit’ has not been declared
/usr/include/c++/4.6/cctype:70:11: error: ‘::isgraph’ has not been declared
/usr/include/c++/4.6/cctype:71:11: error: ‘::islower’ has not been declared
/usr/include/c++/4.6/cctype:72:11: error: ‘::isprint’ has not been declared
/usr/include/c++/4.6/cctype:73:11: error: ‘::ispunct’ has not been declared
/usr/include/c++/4.6/cctype:74:11: error: ‘::isspace’ has not been declared
/usr/include/c++/4.6/cctype:75:11: error: ‘::isupper’ has not been declared
/usr/include/c++/4.6/cctype:76:11: error: ‘::isxdigit’ has not been declared
In file included from /usr/include/c++/4.6/bits/locale_facets.h:43:0,
from /usr/include/c++/4.6/bits/basic_ios.h:39,
from /usr/include/c++/4.6/ios:45,
from main.cpp:1:
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:50:35: error: ‘_ISupper’ was not declared in this scope
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:51:32: error: ‘_ISlower’ was not declared in this scope
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:52:32: error: ‘_ISalpha’ was not declared in this scope
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:53:32: error: ‘_ISdigit’ was not declared in this scope
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:54:33: error: ‘_ISxdigit’ was not declared in this scope
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:55:32: error: ‘_ISspace’ was not declared in this scope
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:56:32: error: ‘_ISprint’ was not declared in this scope
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:57:32: error: ‘_ISalpha’ was not declared in this scope
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:57:43: error: ‘_ISdigit’ was not declared in this scope
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:57:54: error: ‘_ISpunct’ was not declared in this scope
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:58:32: error: ‘_IScntrl’ was not declared in this scope
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:59:32: error: ‘_ISpunct’ was not declared in this scope
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:60:32: error: ‘_ISalpha’ was not declared in this scope
/usr/include/c++/4.6/i686-linux-gnu/./bits/ctype_base.h:60:43: error: ‘_ISdigit’ was not declared in this scope
In file included from /usr/include/c++/4.6/bits/basic_ios.h:39:0,
from /usr/include/c++/4.6/ios:45,
from main.cpp:1:
/usr/include/c++/4.6/bits/locale_facets.h:2530:5: error: ‘std::isspace’ declared as an ‘inline’ variable
/usr/include/c++/4.6/bits/locale_facets.h:2530:5: error: template declaration of ‘bool std::isspace’
/usr/include/c++/4.6/bits/locale_facets.h:2531:7: error: expected primary-expression before ‘return’
/usr/include/c++/4.6/bits/locale_facets.h:2531:7: error: expected ‘}’ before ‘return’
/usr/include/c++/4.6/bits/locale_facets.h:2536:5: error: ‘isprint’ declared as an ‘inline’ variable
/usr/include/c++/4.6/bits/locale_facets.h:2536:5: error: template declaration of ‘bool isprint’
/usr/include/c++/4.6/bits/locale_facets.h:2537:7: error: expected primary-expression before ‘return’
/usr/include/c++/4.6/bits/locale_facets.h:2537:7: error: expected ‘}’ before ‘return’
/usr/include/c++/4.6/bits/locale_facets.h:2537:75: error: expected declaration before ‘}’ token
~/LynX10/src/bug
$
I have diff-ed the output of g++ -v as well as the files locale_facets.h, basic_ios.h, and ios from both machines - they are all identical.
Can anybody shed some light on this for me, please?? How did I mess this up, and, more importantly, how do I fix it? I really don't want to turn my ten year old laptop into a compile server.....