I am working with solaris 9(SunOS mgsun 5.9 Generic_112233-07 sun4u sparc SUNW,Sun-Blade-100).I install the gcc 3.4.6 from sunfreeware website and when I am trying to run it,I am getting the error--
# gcc
ld.so.1: gcc: fatal: libiconv.so.2: open failed: No such file or directory
Killed
when I am trying to see that lib by
# ldd /usr/local/bin/gcc
libiconv.so.2 => (file not found)
libc.so.1 => /usr/lib/libc.so.1
libdl.so.1 => /usr/lib/libdl.so.1
/usr/platform/SUNW,Sun-Blade-100/lib/libc_psr.so.1
so please let me know how can I solve this problem
Set your LD_LIBRARY_PATH for /opt/csw/lib or something. Check the csw website for more instructions.
If it still doesn't work, you got to get the "Internationalization" libraries as well. These are used by a lot of GNU stuff, so there's probably a CSW package that you also have to install. (Could be they didn't check for the dependency).
fpmurphy's answer is correct. As stated in the sunfreeware listing for gcc 3.4.6, the libiconv package needs to be installed so that the libraries are in /usr/local/lib - which needs to be in your library path. The CSW packages have nothing to do with the sunfreeware ones and are not equivalent or used by any sunfreeware packages.
Feel free to email me directory with sunfreeware questions in the future.
I downloaded the libiconv and now I am able to compile the program..
Thanks a lot guys for helping me
but now I am not able to run my program.I have a file test.cpp given below--
#include<iostream>
using namespace std;
int main()
{
cout<<"Welcome to the world of C++"<<endl;
return 0;
}
when I am compiling it using
# gcc -c test.cpp -o test
it is compiling the file and creating the binary file test.o but when I am running it,it is giving error--
# . ./test
syntax error: `\3704' unexpected
so please tell me why It's coming and how to resolve it:confused: