c++ - Running C++11 programs -


i installed gcc4.8 in scientific linux using:

wget -o /etc/yum.repos.d/slc6-devtoolset.repo http://linuxsoft.cern.ch/cern/devtoolset/slc6-devtoolset.repo yum install devtoolset-2  gcc --version gives me: gcc4.8 

now problem when run c++11 programs on gcc (using netbeans ide) error:

/home/topk/cppapplication_7/dist/debug/gnu-linux-x86/cppapplication_7: /usr/lib64/libstdc++.so.6: version `glibcxx_3.4.17' not found (required /home/topk/cppapplication_7/dist/debug/gnu-linux-x86/cppapplication_7) /home/topk/cppapplication_7/dist/debug/gnu-linux-x86/cppapplication_7: /usr/lib64/libstdc++.so.6: version `glibcxx_3.4.14' not found (required /home/topk/cppapplication_7/dist/debug/gnu-linux-x86/cppapplication_7) /home/topk/cppapplication_7/dist/debug/gnu-linux-x86/cppapplication_7: /usr/lib64/libstdc++.so.6: version `glibcxx_3.4.15' not found (required /home/topk/cppapplication_7/dist/debug/gnu-linux-x86/cppapplication_7) 

can please me how can rid of error.

edit: locate libstdc++ output:

/usr/lib/libstdc++-3-libc6.2-2-2.10.0.so /usr/lib/libstdc++-libc6.2-2.so.3 /usr/lib/gcc/x86_64-redhat-linux/4.4.4/libstdc++.a /usr/lib/gcc/x86_64-redhat-linux/4.4.4/libstdc++.so /usr/lib/gcc/x86_64-redhat-linux/4.4.4/32/libstdc++.a /usr/lib/gcc/x86_64-redhat-linux/4.4.4/32/libstdc++.so /usr/lib64/libstdc++.so.5 /usr/lib64/libstdc++.so.5.0.7 /usr/lib64/libstdc++.so.6 /usr/lib64/libstdc++.so.6.0.13 /usr/share/doc/libstdc++-devel-4.4.7 /usr/share/doc/libstdc++-devel-4.4.7/changelog-1998.bz2 /usr/share/doc/libstdc++-devel-4.4.7/changelog-1999.bz2 /usr/share/doc/libstdc++-devel-4.4.7/changelog-2000.bz2 /usr/share/doc/libstdc++-devel-4.4.7/changelog-2001.bz2 /usr/share/doc/libstdc++-devel-4.4.7/changelog-2002.bz2 /usr/share/doc/libstdc++-devel-4.4.7/changelog-2003.bz2 /usr/share/doc/libstdc++-devel-4.4.7/changelog-2004.bz2 /usr/share/doc/libstdc++-devel-4.4.7/changelog-2005.bz2 /usr/share/doc/libstdc++-devel-4.4.7/changelog-2006.bz2 /usr/share/doc/libstdc++-devel-4.4.7/changelog-2007.bz2 /usr/share/doc/libstdc++-devel-4.4.7/changelog.bz2 /usr/share/doc/libstdc++-devel-4.4.7/changelog~.bz2 /usr/share/doc/libstdc++-devel-4.4.7/readme /usr/share/gdb/auto-load/usr/lib/libstdc++.so.6.0.13-gdb.py /usr/share/gdb/auto-load/usr/lib/libstdc++.so.6.0.13-gdb.pyc /usr/share/gdb/auto-load/usr/lib/libstdc++.so.6.0.13-gdb.pyo /usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.13-gdb.py /usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.13-gdb.pyc /usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.13-gdb.pyo /var/lib/yum/yumdb/c/32df1c3f56009c7df737dd4bfbd327bb0aef8d6e-compat-libstdc++-296-2.96-144.el6-i686 /var/lib/yum/yumdb/c/a34683059a40d1d3401aab2723d7b68c8e1cbe15-compat-libstdc++-33-3.2.3-69.el6-x86_64 /var/lib/yum/yumdb/c/32df1c3f56009c7df737dd4bfbd327bb0aef8d6e-compat-libstdc++-296-2.96-144.el6-i686/checksum_data /var/lib/yum/yumdb/c/32df1c3f56009c7df737dd4bfbd327bb0aef8d6e-compat-libstdc++-296-2.96-144.el6-i686/checksum_type /var/lib/yum/yumdb/c/32df1c3f56009c7df737dd4bfbd327bb0aef8d6e-compat-libstdc++-296-2.96-144.el6-i686/from_repo /var/lib/yum/yumdb/c/32df1c3f56009c7df737dd4bfbd327bb0aef8d6e-compat-libstdc++-296-2.96-144.el6-i686/from_repo_revision /var/lib/yum/yumdb/c/32df1c3f56009c7df737dd4bfbd327bb0aef8d6e-compat-libstdc++-296-2.96-144.el6-i686/from_repo_timestamp /var/lib/yum/yumdb/c/32df1c3f56009c7df737dd4bfbd327bb0aef8d6e-compat-libstdc++-296-2.96-144.el6-i686/installed_by /var/lib/yum/yumdb/c/32df1c3f56009c7df737dd4bfbd327bb0aef8d6e-compat-libstdc++-296-2.96-144.el6-i686/reason /var/lib/yum/yumdb/c/32df1c3f56009c7df737dd4bfbd327bb0aef8d6e-compat-libstdc++-296-2.96-144.el6-i686/releasever /var/lib/yum/yumdb/c/a34683059a40d1d3401aab2723d7b68c8e1cbe15-compat-libstdc++-33-3.2.3-69.el6-x86_64/checksum_data /var/lib/yum/yumdb/c/a34683059a40d1d3401aab2723d7b68c8e1cbe15-compat-libstdc++-33-3.2.3-69.el6-x86_64/checksum_type /var/lib/yum/yumdb/c/a34683059a40d1d3401aab2723d7b68c8e1cbe15-compat-libstdc++-33-3.2.3-69.el6-x86_64/from_repo /var/lib/yum/yumdb/c/a34683059a40d1d3401aab2723d7b68c8e1cbe15-compat-libstdc++-33-3.2.3-69.el6-x86_64/from_repo_revision /var/lib/yum/yumdb/c/a34683059a40d1d3401aab2723d7b68c8e1cbe15-compat-libstdc++-33-3.2.3-69.el6-x86_64/from_repo_timestamp /var/lib/yum/yumdb/c/a34683059a40d1d3401aab2723d7b68c8e1cbe15-compat-libstdc++-33-3.2.3-69.el6-x86_64/installed_by /var/lib/yum/yumdb/c/a34683059a40d1d3401aab2723d7b68c8e1cbe15-compat-libstdc++-33-3.2.3-69.el6-x86_64/reason /var/lib/yum/yumdb/c/a34683059a40d1d3401aab2723d7b68c8e1cbe15-compat-libstdc++-33-3.2.3-69.el6-x86_64/releasever /var/lib/yum/yumdb/l/cd38d7a96e461667eb9113f1fddb8a1e43d94178-libstdc++-4.4.7-11.el6-x86_64 /var/lib/yum/yumdb/l/d804bf01331824c1a148301bc5102dd7276e5136-libstdc++-devel-4.4.7-11.el6-x86_64 /var/lib/yum/yumdb/l/cd38d7a96e461667eb9113f1fddb8a1e43d94178-libstdc++-4.4.7-11.el6-x86_64/changed_by /var/lib/yum/yumdb/l/cd38d7a96e461667eb9113f1fddb8a1e43d94178-libstdc++-4.4.7-11.el6-x86_64/checksum_data /var/lib/yum/yumdb/l/cd38d7a96e461667eb9113f1fddb8a1e43d94178-libstdc++-4.4.7-11.el6-x86_64/checksum_type /var/lib/yum/yumdb/l/cd38d7a96e461667eb9113f1fddb8a1e43d94178-libstdc++-4.4.7-11.el6-x86_64/command_line /var/lib/yum/yumdb/l/cd38d7a96e461667eb9113f1fddb8a1e43d94178-libstdc++-4.4.7-11.el6-x86_64/from_repo /var/lib/yum/yumdb/l/cd38d7a96e461667eb9113f1fddb8a1e43d94178-libstdc++-4.4.7-11.el6-x86_64/from_repo_revision /var/lib/yum/yumdb/l/cd38d7a96e461667eb9113f1fddb8a1e43d94178-libstdc++-4.4.7-11.el6-x86_64/from_repo_timestamp /var/lib/yum/yumdb/l/cd38d7a96e461667eb9113f1fddb8a1e43d94178-libstdc++-4.4.7-11.el6-x86_64/installed_by /var/lib/yum/yumdb/l/cd38d7a96e461667eb9113f1fddb8a1e43d94178-libstdc++-4.4.7-11.el6-x86_64/reason /var/lib/yum/yumdb/l/cd38d7a96e461667eb9113f1fddb8a1e43d94178-libstdc++-4.4.7-11.el6-x86_64/releasever /var/lib/yum/yumdb/l/d804bf01331824c1a148301bc5102dd7276e5136-libstdc++-devel-4.4.7-11.el6-x86_64/changed_by /var/lib/yum/yumdb/l/d804bf01331824c1a148301bc5102dd7276e5136-libstdc++-devel-4.4.7-11.el6-x86_64/checksum_data /var/lib/yum/yumdb/l/d804bf01331824c1a148301bc5102dd7276e5136-libstdc++-devel-4.4.7-11.el6-x86_64/checksum_type /var/lib/yum/yumdb/l/d804bf01331824c1a148301bc5102dd7276e5136-libstdc++-devel-4.4.7-11.el6-x86_64/command_line /var/lib/yum/yumdb/l/d804bf01331824c1a148301bc5102dd7276e5136-libstdc++-devel-4.4.7-11.el6-x86_64/from_repo /var/lib/yum/yumdb/l/d804bf01331824c1a148301bc5102dd7276e5136-libstdc++-devel-4.4.7-11.el6-x86_64/from_repo_revision /var/lib/yum/yumdb/l/d804bf01331824c1a148301bc5102dd7276e5136-libstdc++-devel-4.4.7-11.el6-x86_64/from_repo_timestamp /var/lib/yum/yumdb/l/d804bf01331824c1a148301bc5102dd7276e5136-libstdc++-devel-4.4.7-11.el6-x86_64/installed_by /var/lib/yum/yumdb/l/d804bf01331824c1a148301bc5102dd7276e5136-libstdc++-devel-4.4.7-11.el6-x86_64/reason /var/lib/yum/yumdb/l/d804bf01331824c1a148301bc5102dd7276e5136-libstdc++-devel-4.4.7-11.el6-x86_64/releasever 

edit: locate g++ output:

/opt/rh/devtoolset-2/root/usr/bin/g++ /opt/rh/devtoolset-2/root/usr/bin/x86_64-redhat-linux-g++ /opt/rh/devtoolset-2/root/usr/share/man/man1/g++.1.gz /usr/bin/g++ /usr/bin/x86_64-redhat-linux-g++ /usr/lib64/libconfig++.so.8 /usr/lib64/libconfig++.so.8.0.0 /usr/share/man/man1/g++.1.gz 

my guess /usr/lib64/libstdc++.so older library application trying link against... , newer library installed somewhere else, not on search path — or if on search path, comes after old library, why linker attempts link against older one, , fails.

try doing this:

$ g++ program.cpp -l/path/to/new/stdlib -lstdc++ -wl,-rpath=/path/to/new/stdlib 

where /path/to/new/stdlib location of new library. can set on beginning of ld_library_path.


or

you're using older version of g++, , trying against newer version of libstdc++.so. locate g++ , use it. use 4 combinations of g++ , libstdc++ (if there 2 versions of each of them).

hope helps.


Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -