The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 10-06-2008
Registered User
 

Join Date: Sep 2008
Posts: 64
Not able to run gcc

Hi,

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
Reply With Quote
Forum Sponsor
  #2  
Old 10-06-2008
otheus's Avatar
Moderator ala Mode
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 600
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).
Reply With Quote
  #3  
Old 10-06-2008
Moderator
 

Join Date: Dec 2003
Location: /dev/fl
Posts: 1,059
You need to download and install the libiconv package. It is available on sunfreeware and elsewhere.
Reply With Quote
  #4  
Old 10-07-2008
Registered User
 

Join Date: Jun 2008
Posts: 2
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.

Steve Christensen
Sunfreeware.com
Reply With Quote
  #5  
Old 10-07-2008
otheus's Avatar
Moderator ala Mode
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 600
Ooops. Indeed.
Reply With Quote
  #6  
Old 10-07-2008
Registered User
 

Join Date: Sep 2008
Posts: 64
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--

Code:
#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

Thanks in advance
Reply With Quote
  #7  
Old 10-07-2008
Registered User
 

Join Date: May 2008
Location: Philadelphia, PA, USA
Posts: 60
Code:
#include<iostream>
using namespace std;

int main()
{
cout<<"Welcome to the world of C++"<<endl;
return 0;
}

You may want to space things out a little... Although I'm not 100% sure this is causing your problem.
Code:
cout << "Welcome to the world of C++" << endl;
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:57 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0