Sure Corona, I'll try his again tomorrow morning and update you.
---------- Post updated at 11:34 AM ---------- Previous update was at 12:03 AM ----------
Hi Corona,
Didn't work for me or did I do some mistakes? Here is the combined output for a sample program compilation:
[root@p208n11 tr]# ll
total 148
-rwxr-xr-x 1 root root 11055 Feb 18 02:21 a.out
-rw-r--r-- 1 root root 108 Feb 18 02:23 cppProg.cpp
-rw-r--r-- 1 root root 59512 Feb 18 04:11 ldLib.log
-rw-r--r-- 1 root root 59512 Feb 18 04:18 ldLib.log.2
lrwxrwxrwx 1 root root 23 Feb 18 04:23 libstdc++.so -> /usr/lib/libstdc++.so.5
-rwxr-xr-x 1 root root 11055 Feb 18 02:22 og++34Comp
-rw-r--r-- 1 root root 0 Feb 20 00:14 strace.log
[root@p208n11 tr]# strace g++34 libstdc++.so cppProg.cpp -o trcpp2 2> strace.log
[root@p208n11 tr]# ll
total 196
-rwxr-xr-x 1 root root 11055 Feb 18 02:21 a.out
-rw-r--r-- 1 root root 108 Feb 18 02:23 cppProg.cpp
-rw-r--r-- 1 root root 59512 Feb 18 04:11 ldLib.log
-rw-r--r-- 1 root root 59512 Feb 18 04:18 ldLib.log.2
lrwxrwxrwx 1 root root 23 Feb 18 04:23 libstdc++.so -> /usr/lib/libstdc++.so.5
-rwxr-xr-x 1 root root 11055 Feb 18 02:22 og++34Comp
-rw-r--r-- 1 root root 47687 Feb 20 00:15 strace.log
[root@p208n11 tr]# cat cppProg.cpp
#include <iostream.h>
#include <strings.h>
int
main (){
std::cout<< "Hellow world" << endl;
return 0;
}
[root@p208n11 tr]#
[root@p208n11 tr]# g++34 lstdc++.so cppProg.cpp -o trcpp2
g++34: lstdc++.so: No such file or directory
In file included from /usr/lib/gcc/ppc64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/backward/iostream.h:31,
from cppProg.cpp:1:
/usr/lib/gcc/ppc64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
[root@p208n11 tr]# ll
total 172
-rwxr-xr-x 1 root root 11055 Feb 18 02:21 a.out
-rw-r--r-- 1 root root 108 Feb 18 02:23 cppProg.cpp
-rw-r--r-- 1 root root 59512 Feb 18 04:11 ldLib.log
-rw-r--r-- 1 root root 59512 Feb 18 04:18 ldLib.log.2
lrwxrwxrwx 1 root root 23 Feb 18 04:23 libstdc++.so -> /usr/lib/libstdc++.so.5
-rwxr-xr-x 1 root root 11055 Feb 18 02:22 og++34Comp
-rw-r--r-- 1 root root 21159 Feb 20 00:19 strace.log
[root@p208n11 tr]# g++34 lstdc++ cppProg.cpp -o trcpp2
g++34: lstdc++: No such file or directory
In file included from /usr/lib/gcc/ppc64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/backward/iostream.h:31,
from cppProg.cpp:1:
/usr/lib/gcc/ppc64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
[root@p208n11 tr]# ll
total 172
-rwxr-xr-x 1 root root 11055 Feb 18 02:21 a.out
-rw-r--r-- 1 root root 108 Feb 18 02:23 cppProg.cpp
-rw-r--r-- 1 root root 59512 Feb 18 04:11 ldLib.log
-rw-r--r-- 1 root root 59512 Feb 18 04:18 ldLib.log.2
lrwxrwxrwx 1 root root 23 Feb 18 04:23 libstdc++.so -> /usr/lib/libstdc++.so.5
-rwxr-xr-x 1 root root 11055 Feb 18 02:22 og++34Comp
-rw-r--r-- 1 root root 21159 Feb 20 00:19 strace.log
[root@p208n11 tr]# g++34 lstdc cppProg.cpp -o trcpp2
g++34: lstdc: No such file or directory
In file included from /usr/lib/gcc/ppc64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/backward/iostream.h:31,
from cppProg.cpp:1:
/usr/lib/gcc/ppc64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
[root@p208n11 tr]# ll
total 172
-rwxr-xr-x 1 root root 11055 Feb 18 02:21 a.out
-rw-r--r-- 1 root root 108 Feb 18 02:23 cppProg.cpp
-rw-r--r-- 1 root root 59512 Feb 18 04:11 ldLib.log
-rw-r--r-- 1 root root 59512 Feb 18 04:18 ldLib.log.2
lrwxrwxrwx 1 root root 23 Feb 18 04:23 libstdc++.so -> /usr/lib/libstdc++.so.5
-rwxr-xr-x 1 root root 11055 Feb 18 02:22 og++34Comp
-rw-r--r-- 1 root root 21159 Feb 20 00:19 strace.log
[root@p208n11 tr]# g++34 cppProg.cpp -o trcpp2
In file included from /usr/lib/gcc/ppc64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/backward/iostream.h:31,
from cppProg.cpp:1:
/usr/lib/gcc/ppc64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
[root@p208n11 tr]# ll
total 184
-rwxr-xr-x 1 root root 11055 Feb 18 02:21 a.out
-rw-r--r-- 1 root root 108 Feb 18 02:23 cppProg.cpp
-rw-r--r-- 1 root root 59512 Feb 18 04:11 ldLib.log
-rw-r--r-- 1 root root 59512 Feb 18 04:18 ldLib.log.2
lrwxrwxrwx 1 root root 23 Feb 18 04:23 libstdc++.so -> /usr/lib/libstdc++.so.5
-rwxr-xr-x 1 root root 11055 Feb 18 02:22 og++34Comp
-rw-r--r-- 1 root root 21159 Feb 20 00:19 strace.log
-rwxr-xr-x 1 root root 11055 Feb 20 00:20 trcpp2
[root@p208n11 tr]# ldd trcpp2
linux-vdso64.so.1 => (0x00000fff8c800000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000008027d00000)
libm.so.6 => /lib64/power6/libm.so.6 (0x0000008026290000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000008026d40000)
libc.so.6 => /lib64/power6/libc.so.6 (0x0000008026030000)
/lib64/ld64.so.1 (0x0000000042b20000)
[root@p208n11 tr]# echo $LD_LIBRARY_PATH
/root/tr
[root@p208n11 tr]# pwd
/root/tr
[root@p208n11 tr]# g++34 lstdc++.so cppProg.cpp -o trcpp3
g++34: lstdc++.so: No such file or directory
In file included from /usr/lib/gcc/ppc64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/backward/iostream.h:31,
from cppProg.cpp:1:
/usr/lib/gcc/ppc64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
[root@p208n11 tr]# g++34 libstdc++.so cppProg.cpp -o trcpp3
In file included from /usr/lib/gcc/ppc64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/backward/iostream.h:31,
from cppProg.cpp:1:
/usr/lib/gcc/ppc64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
libstdc++.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
[root@p208n11 tr]# ll
total 184
-rwxr-xr-x 1 root root 11055 Feb 18 02:21 a.out
-rw-r--r-- 1 root root 108 Feb 18 02:23 cppProg.cpp
-rw-r--r-- 1 root root 59512 Feb 18 04:11 ldLib.log
-rw-r--r-- 1 root root 59512 Feb 18 04:18 ldLib.log.2
lrwxrwxrwx 1 root root 23 Feb 18 04:23 libstdc++.so -> /usr/lib/libstdc++.so.5
-rwxr-xr-x 1 root root 11055 Feb 18 02:22 og++34Comp
-rw-r--r-- 1 root root 21159 Feb 20 00:19 strace.log
-rwxr-xr-x 1 root root 11055 Feb 20 00:20 trcpp2
[root@p208n11 tr]#
I also ran strace over compilation and the strace log files are attached for your reference. Like:
[root@p208n11 tr]# strace g++34 cppProg.cpp -o trcpp2 2> strace.log
[root@p208n11 tr]# strace g++34 libstdc++.so cppProg.cpp -o trcpp2 2> strace.x.log
Also tried running ldconfig utility, like:
[root@p208n11 tr]# ldconfig -p > ldLib.log
Created a copy of file ldLib.log as ldLib.log.2 and edited the file ldLib.log.2 to swap positions of libstdc++.so.6 and libstdc++.so.5 and ran the config utility again, like:
[root@p208n11 tr]# ldconfig -f ldLib.log.2 2> ldconfig-f.log
Got errors logged into file ldconfig-f.log for reference and is attached herewith this post.
Here are few other information, which might be of help:
[root@p208n11 tr]# uname -a
Linux p208n11.pbm.ihost.com 2.6.32-358.el6.ppc64 #1 SMP Tue Jan 29 11:43:27 EST 2013 ppc64 ppc64 ppc64 GNU/Linux
[root@p208n11 tr]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.4 (Santiago)
[root@p208n11 tr]# g++34 -v
Reading specs from /usr/lib/gcc/ppc64-redhat-linux/3.4.6/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,f77 --disable-libgcj --host=ppc64-redhat-linux
Thread model: posix
gcc version 3.4.6 20060404 (Red Hat 3.4.6-19.el6)
[root@p208n11 tr]# /usr/bin/ldd --version
ldd (GNU libc) 2.12
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.