Solved

Gcc on Suse Linux failing because it cannot find libgcc

Posted on 2013-01-07
5
2,417 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

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…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

717 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