Operating System - Linux
1753341 Members
5177 Online
108792 Solutions
New Discussion юеВ

Re: Regarding error when starting g++

 
vivek1717
Occasional Contributor

Regarding error when starting g++

Hi All,
I have just installed gcc 4.1.1 and when i try to execute g++, i am getting this error:
sh-3.2# g++
/usr/lib/pa20_64/dld.sl: Unable to find library 'libiconv.sl.4'.
Killed
I have installed libiconv also.
I have the following version of gcc:
sh-3.2# gcc --v
Using built-in specs.
Target: hppa2.0w-hp-hpux11.11
Configured with: ../src/configure --enable-languages=c,c++ --prefix=/usr/local/pa20_32 --with-local-prefix=/usr/local/pa20_32 --with-gnu-as --with-as=/usr/local/pa20_32/bin/as --with-ld=/usr/ccs/bin/ld --disable-shared --disable-nls
Thread model: single
gcc version 4.1.1
OS: B.11.11 U 9000/785 2008505106

Thanks and Regards,
Vivek


3 REPLIES 3
Steven Schweda
Honored Contributor

Re: Regarding error when starting g++

> OS: B.11.11 U 9000/785 2008505106

There is an HP-UX forum, which might work
better for this question than this Linux
forum.

http://forums.itrc.hp.com/service/forums/familyhome.do?familyId=117

> I have just installed gcc 4.1.1 [...]

From what? How?

> I have installed libiconv also.

From what? How?

Are you using the "g++" which you installed?

If you have a working gcc, you might try
building a complete GCC kit from source.
Version 4.3.1 seems to be current. 4.3.0
worked well for me on a similar system
(after getting all the (many) prerequisites
lined up).

http://gcc.gnu.org/
Matti_Kurkela
Honored Contributor

Re: Regarding error when starting g++

Welcome to the ITRC Forums!

(Nitpick: this specific part of the forums is for Linux, but the question is about HP-UX. I'll submit a request to move the thread to the appropriate forum section.)

Where did you get your gcc from?
Did you know that HP offers a pre-packaged GCC for the currently-supported versions of HP-UX?
See:
http://www.hp.com/go/gcc

Maybe your libiconv library is not located where g++ expects to find it? Or maybe the g++ requires a _64-bit_ version of the library?

Run "ldd $(which g++)" to see all the libraries required by g++.
Run "chatr $(which g++)" to find out where the g++ binary expects to find these libraries.

Show us the output of those commands, so that we might be able to help you better.

MK
MK
Larry Liimatainen
New Member

Re: Regarding error when starting g++

If you have g++ and gcc, you probably have binutils, run ldd on g++:
"/usr/local/bin/ldd /usr/local/bin/g++"

This tell you what version g++ wants of libiconv. In your example it seems g++ has told the dynamic linker dld that it wants libiconv.sl.4

If you have it installed but maybe in some path dld cant find, (example /usr/local/lib) then try:
LD_LIBRARY_PATH=/usr/local/lib g++

Also try symlinking your libiconv file to "libiconv.sl.4" in some temporary dir and point LD_LIBRARY_PATH to it like above.