Do you know where it would come from ("/opt/csw/gcc4/lib/libstdc++.so") ? The
only place where I have to pass the /opt/csw/gcc4/lib is when I configure a
package. ( ./configure LDFLAGS=-R/opt/csw/gcc4/lib)
-bash-3.00$ env
TERM=xterm
SHELL=/usr/bin/bash
SSH_CLIENT=172.21.9.118 1585 22
SSH_TTY=/dev/pts/1
USER=sbsmlat
MAIL=/var/mail//sbsmlat
PATH=/usr/ccs/bin:/usr/local/bin:/usr/bin
PWD=/export/home/sbsmlat/PKGS
TZ=US/Eastern
SHLVL=1
HOME=/export/home/sbsmlat
LOGNAME=sbsmlat
SSH_CONNECTION=172.21.9.118 1585 192.168.40.25 22
_=/usr/bin/env
OLDPWD=/export/home/sbsmlat
Thanks,
Nitin.
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Maciej
Blizinski
Sent: Monday, April 11, 2011 6:35 PM
To: Questions and discussions
Subject: Re: [csw-users] GCC4 ld Warnings
2011/4/11 Kapoor, Nitin <[email protected]>:
> (...) -licuuc -licudata -lnsl -lsocket -lpthread -ldl
> /opt/csw/gcc4/lib/libstdc++.so
I believe that the culprit is the explicit
"/opt/csw/gcc4/lib/libstdc++.so" parameter given to the linker, you
can see it up there in the output. Here's a minimal example to
reproduce this behavior:
maciej@netra ~/src/gcc-test $ cat Makefile
PATH := /opt/csw/bin:/opt/csw/gcc4/bin:$(PATH)
LDFLAGS = -R/opt/csw/gcc4/lib -L/opt/csw/gcc4/lib $(EXTRA_LDFLAGS)
CC = gcc
CXX = g++
all: foo
foo: foo.cpp
foo.cpp: Makefile
echo '#include <stdio.h>' > foo.cpp
echo 'main(void) { printf("Hello world!\\n"); }' >> foo.cpp
clean:
rm -f foo foo.o foo.cpp
maciej@netra ~/src/gcc-test $ gmake
echo '#include <stdio.h>' > foo.cpp
echo 'main(void) { printf("Hello world!\\n"); }' >> foo.cpp
g++ -R/opt/csw/gcc4/lib -L/opt/csw/gcc4/lib foo.cpp -o foo
maciej@netra ~/src/gcc-test $ gmake clean
rm -f foo foo.o foo.cpp
maciej@netra ~/src/gcc-test $ gmake EXTRA_LDFLAGS=/opt/csw/gcc4/lib/libstdc++.so
echo '#include <stdio.h>' > foo.cpp
echo 'main(void) { printf("Hello world!\\n"); }' >> foo.cpp
g++ -R/opt/csw/gcc4/lib -L/opt/csw/gcc4/lib
/opt/csw/gcc4/lib/libstdc++.so foo.cpp -o foo
ld: warning: file /opt/csw/gcc4/lib/libstdc++.so: attempted multiple
inclusion of file
maciej@netra ~/src/gcc-test $
To fix the warning in your case, you need to analyze the build system
of the software you're building, and find out why the explicit
reference to libstdc++.so appears in the linker invocation. If you
manage to remove it, the warning should disappear.
Maciej
_______________________________________________
users mailing list
[email protected]
https://lists.opencsw.org/mailman/listinfo/users
-
This message is intended only for the addressee and may contain information
that is company confidential or privileged. Any technical data in this message
may be exported only in accordance with the U.S. International Traffic in Arms
Regulations (22 CFR Parts 120-130) or the Export Administration Regulations (15
CFR Parts 730-774). Unauthorized use is strictly prohibited and may be
unlawful. If you are not the intended recipient, or the person responsible for
delivering to the intended recipient, you should not read, copy, disclose or
otherwise use this message. If you have received this email in error, please
delete it, and advise the sender immediately.
-
_______________________________________________
users mailing list
[email protected]
https://lists.opencsw.org/mailman/listinfo/users