LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-03-2012, 07:10 AM   #1
naveennaik
LQ Newbie
 
Registered: Sep 2012
Posts: 3

Rep: Reputation: Disabled
getting error in gcc


Hi all,

I am compiling code in RHEL 6.2 which is already compiled successfully in RHEL 5.2.. 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;
^
 
Old 09-03-2012, 08:44 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Welcome to LQ.

Probably use "The other compiler" = gcc34 :
# yum install compat-gcc-34-c++
... which will provide /usr/bin/ gcc34 g++34

.
 
Old 09-04-2012, 12:48 AM   #3
naveennaik
LQ Newbie
 
Registered: Sep 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Can we use gcc lower version in 6.2 RHEL, what about dependencies?
Should I need to uninstall all gcc rpms and install rpms from lower version?
 
Old 09-04-2012, 04:22 AM   #4
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,623

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
Quote:
Should I need to uninstall all gcc rpms and install rpms from lower version?
NO
you can have a few different versions installed at the SAME time

on SL6.3 i have 4.4 and 3.4
on OpenSUSE 12 i have 3.4 ,4.1,4.3,4.6

some "older" programs will NOT build with the newer " more STRICT" versions

search the RHN repo
Code:
su -
yum search gcc
gcc.x86_64 -- is the current
compat-gcc-34.x86_64 -- is the compatibility old compiler
you also might want the "Compatibility libraries" group and "Development tools"
Code:
su -
yum grouplist
---- from the list ---
yum groupinstall "Compatibility libraries" "Development tools"
 
Old 09-04-2012, 08:31 AM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Quote:
Can we use gcc lower version in 6.2 RHEL, what about dependencies ?
Compilers usually have few dependencies, older versions : None.

You can have have as may versions of gcc / g++ (c++) as you want,
installed at the same time. They have unique file names / location :
No conflicts.

Just write CC=gcc34 , CXX=g++34 in your Makefile, or use :
export CC=gcc34 CXX=g++34 && ./configure && make

Sometimes this can be used too : make CC=gcc34 CXX=g++34

.
 
Old 09-05-2012, 03:54 AM   #6
naveennaik
LQ Newbie
 
Registered: Sep 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Ya, Thanks for the reply.

I will be trying this, I think it should work.

Thanks.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gcc-4.5.2 - Pass 1 error -gcc command not found ?? adi_30stm Linux From Scratch 20 11-17-2011 12:23 PM
gcc (GCC) 4.3.2 20081105 (Red Hat 4.3.2-7) compilation error adhesh_19 Red Hat 0 01-05-2010 05:34 AM
Compile error, 'H5G_obj_t' does not name a type, is gcc 4.3 incompatible with gcc 3 ? samrat_rao Linux - Software 5 03-03-2009 02:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration