LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Getting error during compilation with g++ on RHEL6.2 (https://www.linuxquestions.org/questions/linux-newbie-8/getting-error-during-compilation-with-g-on-rhel6-2-a-4175487579/)

rpavankumar 12-11-2013 03:31 AM

Getting error during compilation with g++ on RHEL6.2
 
Hi all,
I am compiling code in RHEL 6.2 which is already compiled successfully different machine with same configureation.. getting lots of standard error related to namespace please let me know the resolution for this.
errors like: Generating /udir/naveen/from_35/data/objectstore/abl.adb & osschema_libabl.cc (-assf flag) "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/bits/stringfwd.h", line 42: error: expected a "{" namespace std __attribute__ ((__visibility__ ("default"))) { ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/cstddef", line 49: error: expected a "{" namespace std __attribute__ ((__visibility__ ("default"))) { ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/cwchar", line 65: error: expected a "{" namespace std __attribute__ ((__visibility__ ("default"))) { ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/cwchar", line 139: error: expected a "{" namespace std __attribute__ ((__visibility__ ("default"))) { ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/cwchar", line 238: error: expected a "{" namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) { ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/cwchar", line 260: error: expected a "{" namespace std __attribute__ ((__visibility__ ("default"))) { ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/cwchar", line 262: error: name followed by "::" must be a class or namespace name using ::__gnu_cxx::wcstold; ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/cwchar", line 263: error: name followed by "::" must be a class or namespace name using ::__gnu_cxx::wcstoll; ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/cwchar", line 264: error: name followed by "::" must be a class or namespace name using ::__gnu_cxx::wcstoull; ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/bits/postypes.h", line 70: error: expected a "{" namespace std __attribute__ ((__visibility__ ("default"))) { ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/iosfwd", line 44: error: expected a "{" namespace std __attribute__ ((__visibility__ ("default"))) { ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/iosfwd", line 46: error: char_traits is not a template template<typename _CharT, typename _Traits = char_traits<_CharT> > ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/iosfwd", line 49: error: char_traits is not a template template<typename _CharT, typename _Traits = char_traits<_CharT> > ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/iosfwd", line 52: error: char_traits is not a template template<typename _CharT, typename _Traits = char_traits<_CharT> > ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/iosfwd", line 55: error: char_traits is not a template template<typename _CharT, typename _Traits = char_traits<_CharT> > ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/iosfwd", line 58: error: char_traits is not a template template<typename _CharT, typename _Traits = char_traits<_CharT> > ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/iosfwd", line 61: error: char_traits is not a template template<typename _CharT, typename _Traits = char_traits<_CharT>, ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/iosfwd", line 62: error: allocator is not a template typename _Alloc = allocator<_CharT> > ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/iosfwd", line 65: error: char_traits is not a template template<typename _CharT, typename _Traits = char_traits<_CharT>, ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/iosfwd", line 66: error: allocator is not a template typename _Alloc = allocator<_CharT> > ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/iosfwd", line 69: error: char_traits is not a template template<typename _CharT, typename _Traits = char_traits<_CharT>, ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/iosfwd", line 70: error: allocator is not a template typename _Alloc = allocator<_CharT> > ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/iosfwd", line 73: error: char_traits is not a template template<typename _CharT, typename _Traits = char_traits<_CharT>, ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/iosfwd", line 74: error: allocator is not a template typename _Alloc = allocator<_CharT> > ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/iosfwd", line 77: error: char_traits is not a template template<typename _CharT, typename _Traits = char_traits<_CharT> > ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/iosfwd", line 80: error: char_traits is not a template template<typename _CharT, typename _Traits = char_traits<_CharT> > ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/iosfwd", line 83: error: char_traits is not a template template<typename _CharT, typename _Traits = char_traits<_CharT> > ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/iosfwd", line 86: error: char_traits is not a template template<typename _CharT, typename _Traits = char_traits<_CharT> > ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/iosfwd", line 89: error: char_traits is not a template template<typename _CharT, typename _Traits = char_traits<_CharT> > ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/iosfwd", line 92: error: char_traits is not a template template<typename _CharT, typename _Traits = char_traits<_CharT> > ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/exception", line 120: error: expected a "{" namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) { ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/bits/functexcept.h", line 39: error: expected a "{" namespace std __attribute__ ((__visibility__ ("default"))) { ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/bits/cpp_type_traits.h", line 69: error: expected a "{" namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) { ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/bits/cpp_type_traits.h", line 76: error: expected a "{" namespace std __attribute__ ((__visibility__ ("default"))) { ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/bits/cpp_type_traits.h", line 310: error: name followed by "::" must be a class or namespace name struct __is_normal_iterator< __gnu_cxx::__normal_iterator<_Iterator, ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/bits/cpp_type_traits.h", line 310: error: too many arguments for class template "<error>::__is_normal_iterator" struct __is_normal_iterator< __gnu_cxx::__normal_iterator<_Iterator, ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/ext/type_traits.h", line 37: error: expected a "{" namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) { ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/ext/type_traits.h", line 64: error: namespace "std" has no member "__is_integer" typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type; ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/ext/type_traits.h", line 64: error: type name is not allowed typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type; ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/ext/type_traits.h", line 64: error: too few arguments for class template "<error>::__enable_if" typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type; ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/ext/type_traits.h", line 64: error: template parameter "_Tp" may not be redeclared in this scope typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type; ^ "/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/ext/type_traits.h", line 64: error: expected a ";" typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type; ^

JJJCR 12-11-2013 03:54 AM

what are you trying to compile,is it your own program? or is it from other party?

rpavankumar 12-11-2013 04:51 AM

This code is part of my project.

JJJCR 12-11-2013 05:01 AM

Quote:

Originally Posted by rpavankumar (Post 5078874)
This code is part of my project.

I'm not really a software guy, but if you can debug your program or if it is possible to compile by module then do it by module.

In that way you can keep track which part of the code is giving trouble.

And have you tried to compile it using CentOS instead of RHEL?

Drakeo 12-11-2013 06:06 AM

that read out point to the header file and actually tells you that the newer gcc well very old old old compiler 4.4.6 needs. look at it real close.
it is telling you what your suppose to change.
Quote:

/bits/cpp_type_traits.h", line 76: error: expected a "{"
It is your code fix it up to compile in the 4.4.6 you probably had 4.3.x 4.4.3 or 4.4.4 before

Quote:

no that means you have one too many of these also it would be nice if you showed your whole code
or you missing a brace

JJJCR 12-11-2013 06:59 AM

Quote:

Originally Posted by Drakeo (Post 5078902)
that read out point to the header file and actually tells you that the newer gcc well very old old old compiler 4.4.6 needs. look at it real close.
it is telling you what your suppose to change.
It is your code fix it up to compile in the 4.4.6 you probably had 4.3.x 4.4.3 or 4.4.4 before

Ohh..Drakeo..you can interpret it..i suppose you're a graveyard guy..hahahah..actually its nice to code at night.. hehehe...

rpavankumar 12-11-2013 07:41 AM

Quote:

Originally Posted by Drakeo (Post 5078902)
that read out point to the header file and actually tells you that the newer gcc well very old old old compiler 4.4.6 needs. look at it real close.
it is telling you what your suppose to change.
It is your code fix it up to compile in the 4.4.6 you probably had 4.3.x 4.4.3 or 4.4.4 before

HI Drakeo,
Currently i was using gcc 4.4.6 in my new machine. The same code was compiled in my old machine with same compiler, even machine configuration was also same.


All times are GMT -5. The time now is 03:18 AM.