Solved

Gcc on Suse Linux failing because it cannot find libgcc

Posted on 2013-01-07
5
2,337 Views
Last Modified: 2013-01-21
Hello.

My gcc compile is failing because it can't find library libgcc. My problem is I don't know which library to install to fix this. I have tried all the ones I can think on my distribution disk, but so far no luck.

gcc -m32 -L /usr/local/java/lib -L /usr/lib -L /lib -ldl-2.11.1  -lpthread-2.11.1 jsvc-unix.o libservice.a -o ../../jsvc
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.3/libgcc.a when searching for -lgcc
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: cannot find -lgcc

Note the error message: /usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: cannot find -lgcc

I expected that libgcc would be loaded by default because I have the compiler installed
0
Comment
Question by:Christopher Schene
  • 3
  • 2
5 Comments
 
LVL 32

Expert Comment

by:phoffric
ID: 38752514
>> -m32
See if -m64 helps instead of -m32
0
 

Author Comment

by:Christopher Schene
ID: 38752770
Hi Phoffric,

Sorry, I should have mentioned that I am required to have a 32 bit compile. 64 bit is not an option becasue of other software I integrate with. I'll need the 32 bit libraries.

I would have expected since I have a 32 bit compiler installed I would have libgcc as a default. I am specifying /lib and /usr/lib as paths and I believe those are the locations of the 32 bit libraries.

I did find these two libraries: How do I specify that gcc should use them?

/lib/libgcc_s.so.1
/lib/libgcc.so.1


Thanks,

Chris
0
 
LVL 32

Accepted Solution

by:
phoffric earned 500 total points
ID: 38764861
>> I am specifying /lib and /usr/lib as paths
As library paths, right? You could also use explicit paths in the gcc command (but that just indicates that something is awry with your installation).

Have you seen the ideas presented here:
   http://www.network-theory.co.uk/docs/gccintro/gccintro_25.html

and in Step 4 Making the library available at runtime:
   http://www.cprogramming.com/tutorial/shared-libraries-linux-gcc.html
0
 

Author Comment

by:Christopher Schene
ID: 38784084
This is what I found to be a solution

1) zypper remove gcc
2) zypper in gcc32-32bit
3) zypper in gcc

basically I removed gcc and replaced it with the 32 bit versin
0
 
LVL 32

Expert Comment

by:phoffric
ID: 38784487
Great!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help With Shell Script Centos 6 6 89
Samba Question 11 105
Reactjs with .NET 3 74
Exchange Server Send connector and DNS Round Robin ? 6 44
If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question