LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-17-2006, 06:48 AM   #1
yashwantpinge
LQ Newbie
 
Registered: Nov 2005
Posts: 17

Rep: Reputation: 0
c++ program compilation error


Hello,

I am created a one basic program in suse which outputs a small sentance.

I am facing the problem during the compilation of program.

g++ -o ex ex.c
/usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../../i586-suse-linux/bin/ld: cannot find -lgcc_s


Any body tell me what i am doing wrong here ....?
 
Old 03-17-2006, 08:37 AM   #2
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
Code:
g++ -o ex ex.c
i dont know if it is causing the problem but if this is C code then use gcc to compile.. if it is C++ code then change the file to ex.cpp..
 
Old 03-17-2006, 12:48 PM   #3
geeman2.0
Member
 
Registered: Feb 2005
Location: Ontario, Canada
Distribution: Gentoo, Slackware
Posts: 345

Rep: Reputation: 30
I'm not positive, but I think your install might be crippled.
Maybe you're missing some fundamental g++ libraries.
 
Old 03-17-2006, 08:09 PM   #4
pranavojha
Member
 
Registered: Feb 2006
Location: Bangalore, India
Distribution: Fedora Core 3
Posts: 68

Rep: Reputation: 15
try this

Quote:
Originally Posted by yashwantpinge
Hello,

I am facing the problem during the compilation of program.

g++ -o ex ex.c
/usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../../i586-suse-linux/bin/ld: cannot find -lgcc_s

Any body tell me what i am doing wrong here ....?
Well there is definitely a problem with your libraries. try reinstalling the development kit. Since your g++ compiler doesn't work try using gcc

Code:
gcc -o ex ex.c
As your code is in C you can try cc

Code:
cc -o ex ex.c
 
Old 03-17-2006, 10:38 PM   #5
yashwantpinge
LQ Newbie
 
Registered: Nov 2005
Posts: 17

Original Poster
Rep: Reputation: 0
hello,

At the end of yesterday, i solved the problem by coping the libgcc_s.so.1 library from /usr/lib to /lib.

And offcourse, you can comile the C++ prgram ex.c
in GNU enviornment as

g++ -o ex ex.c

Last edited by yashwantpinge; 03-17-2006 at 10:43 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
qt program compilation error sateeshgalla Programming 1 08-26-2005 05:33 AM
gtk program compilation error RohanShrivastav Programming 5 02-16-2005 07:12 AM
c program compilation harun_acs Programming 3 03-18-2004 10:29 AM
Compilation of Program? drdroid Programming 5 12-09-2003 05:41 PM
error during program compilation with RH7.1 Corinne Linux - Newbie 1 06-14-2001 08:25 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration