Help!

Linking errors in Suse 10 64 bit machine!!!!! please help ..


Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> SUSE RSS
Next:  GRUB problem?  
Author Message
satish.lvr
External


Since: Aug 07, 2007
Posts: 5



PostPosted: Tue Aug 07, 2007 10:26 pm    Post subject: Linking errors in Suse 10 64 bit machine!!!!! please help me!!!!
Archived from groups: alt>os>linux>suse (more info?)

Hi Group,

I am using Suse 10 x86_64 machine. I built my libs using -m32 option.
The libs were
built successfully. but when I try to link libs to my application, it
is giving following errors:

/usr/lib64/gcc/x86_64-suse-linux/4.1.0/../../../../x86_64-suse-linux/
bin/ld: skipping incompatible /home/satish/project/lib/libtest.a when
searching for -ltest
/usr/lib64/gcc/x86_64-suse-linux/4.1.0/../../../../x86_64-suse-linux/
bin/ld: cannot find -ltest


I tried by building my application using with and with out -m32. but
still it is giving the same error in both cases...

Can you please tell me what's going wrong in this???



Thanks & Regards
Satish.
Back to top
satish.lvr
External


Since: Aug 07, 2007
Posts: 5



PostPosted: Wed Aug 08, 2007 3:40 am    Post subject: Re: Linking errors in Suse 10 64 bit machine!!!!! please help me!!!! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Aug 8, 12:31 pm, TW <trala....RemoveThis@joepie.nl> wrote:
> satish.....RemoveThis@gmail.com wrote:
> > Hi Group,
>
> > I am using Suse 10 x86_64 machine. I built my libs using -m32 option.
> > The libs were
> > built successfully. but when I try to link libs to my application, it
> > is giving following errors:
>
> > /usr/lib64/gcc/x86_64-suse-linux/4.1.0/../../../../x86_64-suse-linux/
> > bin/ld: skipping incompatible /home/satish/project/lib/libtest.a when
> > searching for -ltest
> > /usr/lib64/gcc/x86_64-suse-linux/4.1.0/../../../../x86_64-suse-linux/
> > bin/ld: cannot find -ltest
>
> > I tried by building my application using with and with out -m32. but
> > still it is giving the same error in both cases...
>
> > Can you please tell me what's going wrong in this???
>
> Did you set your LD_LIBRARY_PATH environment variable?
> taco
>
>
>
> > Thanks & Regards
> > Satish.- Hide quoted text -
>
> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

Hi,

Yes. I set as /usr/lib and /usr/local/lib

Is it OK? Do I need to add anything more?

Regards
Satish.
Back to top
satish.lvr
External


Since: Aug 07, 2007
Posts: 5



PostPosted: Wed Aug 08, 2007 4:22 am    Post subject: Re: Linking errors in Suse 10 64 bit machine!!!!! please help me!!!! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Aug 8, 4:05 pm, Mathias Waack <M.Wa... DeleteThis @gmx.de> wrote:
> satish.... DeleteThis @gmail.com wrote:
> > I am using Suse 10 x86_64 machine. I built my libs using -m32 option.
> > The libs were
> > built successfully. but when I try to link libs to my application, it
> > is giving following errors:
>
> > /usr/lib64/gcc/x86_64-suse-linux/4.1.0/../../../../x86_64-suse-linux/
> > bin/ld: skipping incompatible /home/satish/project/lib/libtest.a when
> > searching for -ltest
> > /usr/lib64/gcc/x86_64-suse-linux/4.1.0/../../../../x86_64-suse-linux/
> > bin/ld: cannot find -ltest
>
> > I tried by building my application using with and with out -m32. but
> > still it is giving the same error in both cases...
>
> Could you please post the real command line used for linking your app or the
> Makefile you've used? Looks like your linker doesn't know about the -m32
> switch, its only searching for 64 bit libs.
>
> Mathias

Hi,

The linking in Makefile is like this:

all: $(EXECUTABLE)

$(EXECUTABLE): $(C_OBJS) $(CPP_OBJS)
$(CXX) $(C_OBJS) $(CPP_OBJS) -o $@ $(LFLAGS)

where LFLAGS=$(LIBDIRS) -l test

Regards
Satish.
Back to top
TW
External


Since: Jun 28, 2007
Posts: 18



PostPosted: Wed Aug 08, 2007 9:31 am    Post subject: Re: Linking errors in Suse 10 64 bit machine!!!!! please help me!!!! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

satish.lvr.DeleteThis@gmail.com wrote:

> Hi Group,
>
> I am using Suse 10 x86_64 machine. I built my libs using -m32 option.
> The libs were
> built successfully. but when I try to link libs to my application, it
> is giving following errors:
>
> /usr/lib64/gcc/x86_64-suse-linux/4.1.0/../../../../x86_64-suse-linux/
> bin/ld: skipping incompatible /home/satish/project/lib/libtest.a when
> searching for -ltest
> /usr/lib64/gcc/x86_64-suse-linux/4.1.0/../../../../x86_64-suse-linux/
> bin/ld: cannot find -ltest
>
>
> I tried by building my application using with and with out -m32. but
> still it is giving the same error in both cases...
>
> Can you please tell me what's going wrong in this???
>
>
>

Did you set your LD_LIBRARY_PATH environment variable?
taco

> Thanks & Regards
> Satish.
Back to top
Mathias Waack
External


Since: Aug 08, 2007
Posts: 1



PostPosted: Wed Aug 08, 2007 11:05 am    Post subject: Re: Linking errors in Suse 10 64 bit machine!!!!! please help me!!!! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

satish.lvr.DeleteThis@gmail.com wrote:

> I am using Suse 10 x86_64 machine. I built my libs using -m32 option.
> The libs were
> built successfully. but when I try to link libs to my application, it
> is giving following errors:
>
> /usr/lib64/gcc/x86_64-suse-linux/4.1.0/../../../../x86_64-suse-linux/
> bin/ld: skipping incompatible /home/satish/project/lib/libtest.a when
> searching for -ltest
> /usr/lib64/gcc/x86_64-suse-linux/4.1.0/../../../../x86_64-suse-linux/
> bin/ld: cannot find -ltest
>
>
> I tried by building my application using with and with out -m32. but
> still it is giving the same error in both cases...

Could you please post the real command line used for linking your app or the
Makefile you've used? Looks like your linker doesn't know about the -m32
switch, its only searching for 64 bit libs.

Mathias
Back to top
TW
External


Since: Jun 28, 2007
Posts: 18



PostPosted: Wed Aug 08, 2007 4:00 pm    Post subject: Re: Linking errors in Suse 10 64 bit machine!!!!! please help me!!!! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

satish.lvr RemoveThis @gmail.com wrote:

> On Aug 8, 12:31 pm, TW <trala... RemoveThis @joepie.nl> wrote:
>> satish.... RemoveThis @gmail.com wrote:
>> > Hi Group,
>>
>> > I am using Suse 10 x86_64 machine. I built my libs using -m32 option.
>> > The libs were
>> > built successfully. but when I try to link libs to my application, it
>> > is giving following errors:
>>
>> > /usr/lib64/gcc/x86_64-suse-linux/4.1.0/../../../../x86_64-suse-linux/
>> > bin/ld: skipping incompatible /home/satish/project/lib/libtest.a when
>> > searching for -ltest
>> > /usr/lib64/gcc/x86_64-suse-linux/4.1.0/../../../../x86_64-suse-linux/
>> > bin/ld: cannot find -ltest
>>
>> > I tried by building my application using with and with out -m32. but
>> > still it is giving the same error in both cases...
>>
>> > Can you please tell me what's going wrong in this???
>>
>> Did you set your LD_LIBRARY_PATH environment variable?
>> taco
>>
>>
>>
>> > Thanks & Regards
>> > Satish.- Hide quoted text -
>>
>> - Show quoted text -- Hide quoted text -
>>
>> - Show quoted text -
>
> Hi,
>
> Yes. I set as /usr/lib and /usr/local/lib
>
> Is it OK? Do I need to add anything more?
>
> Regards
> Satish.
Hi, What I wrote about ld_library_path is bullshit. sorry. the following is
perhaps some help.
All 32 bit gcc development tools installed? Check with yast.
check if 32 bits libraries come up if you execute /sbin/ldconfig -p
For example on my system I get:
>/sbin/ldconfig -p|grep libm.so
libm.so.6 (libc6,x86-64, OS ABI: Linux 2.6.4) => /lib64/libm.so.6
libm.so.6 (libc6, OS ABI: Linux 2.6.4) => /lib/libm.so.6
libm.so (libc6,x86-64, OS ABI: Linux 2.6.4) => /usr/lib64/libm.so
libm.so (libc6, OS ABI: Linux 2.6.4) => /usr/lib/libm.so
which shows that both are included. Does a hello world compile in 32 bits.
Works in my case but didn't try anything with so files.

In your case ld is still trying to link with libraries from lib64 instead of
your 32 bits libs. A workaround could be to make a symbolic links to all
dependent libraries (find out with ldd). Another possibility is to chroot
everything, ....
taco
Back to top
satish.lvr
External


Since: Aug 07, 2007
Posts: 5



PostPosted: Wed Aug 08, 2007 9:51 pm    Post subject: Re: Linking errors in Suse 10 64 bit machine!!!!! please help me!!!! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Aug 8, 7:00 pm, TW <trala... DeleteThis @joepie.nl> wrote:
> satish.... DeleteThis @gmail.com wrote:
> > On Aug 8, 12:31 pm, TW <trala... DeleteThis @joepie.nl> wrote:
> >> satish.... DeleteThis @gmail.com wrote:
> >> > Hi Group,
>
> >> > I am using Suse 10 x86_64 machine. I built my libs using -m32 option.
> >> > The libs were
> >> > built successfully. but when I try to link libs to my application, it
> >> > is giving following errors:
>
> >> > /usr/lib64/gcc/x86_64-suse-linux/4.1.0/../../../../x86_64-suse-linux/
> >> > bin/ld: skipping incompatible /home/satish/project/lib/libtest.a when
> >> > searching for -ltest
> >> > /usr/lib64/gcc/x86_64-suse-linux/4.1.0/../../../../x86_64-suse-linux/
> >> > bin/ld: cannot find -ltest
>
> >> > I tried by building my application using with and with out -m32. but
> >> > still it is giving the same error in both cases...
>
> >> > Can you please tell me what's going wrong in this???
>
> >> Did you set your LD_LIBRARY_PATH environment variable?
> >> taco
>
> >> > Thanks & Regards
> >> > Satish.- Hide quoted text -
>
> >> - Show quoted text -- Hide quoted text -
>
> >> - Show quoted text -
>
> > Hi,
>
> > Yes. I set as /usr/lib and /usr/local/lib
>
> > Is it OK? Do I need to add anything more?
>
> > Regards
> > Satish.
>
> Hi, What I wrote about ld_library_path is bullshit. sorry. the following is
> perhaps some help.
> All 32 bit gcc development tools installed? Check with yast.
> check if 32 bits libraries come up if you execute /sbin/ldconfig -p
> For example on my system I get:>/sbin/ldconfig -p|grep libm.so
>
> libm.so.6 (libc6,x86-64, OS ABI: Linux 2.6.4) => /lib64/libm.so.6
> libm.so.6 (libc6, OS ABI: Linux 2.6.4) => /lib/libm.so.6
> libm.so (libc6,x86-64, OS ABI: Linux 2.6.4) => /usr/lib64/libm.so
> libm.so (libc6, OS ABI: Linux 2.6.4) => /usr/lib/libm.so
> which shows that both are included. Does a hello world compile in 32 bits.
> Works in my case but didn't try anything with so files.
>
> In your case ld is still trying to link with libraries from lib64 instead of
> your 32 bits libs. A workaround could be to make a symbolic links to all
> dependent libraries (find out with ldd). Another possibility is to chroot
> everything, ....
> taco- Hide quoted text -
>
> - Show quoted text -

Hi,

Thanks alot for your reply. I am very new to Suse. Can you explain me
in detail how can be done with ldd?

Thank you...

Regards
Satish.
Back to top
satish.lvr
External


Since: Aug 07, 2007
Posts: 5



PostPosted: Thu Aug 09, 2007 1:41 am    Post subject: Re: Linking errors in Suse 10 64 bit machine!!!!! please help me!!!! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Aug 9, 1:20 pm, TW <trala....TakeThisOut@joepie.nl> wrote:
> satish.....TakeThisOut@gmail.com wrote:
>
> >> Hi, What I wrote about ld_library_path is bullshit. sorry. the following
> >> is perhaps some help.
> >> All 32 bit gcc development tools installed? Check with yast.
> >> check if 32 bits libraries come up if you execute /sbin/ldconfig -p
> >> For example on my system I get:>/sbin/ldconfig -p|grep libm.so
>
> >> libm.so.6 (libc6,x86-64, OS ABI: Linux 2.6.4) => /lib64/libm.so.6
> >> libm.so.6 (libc6, OS ABI: Linux 2.6.4) => /lib/libm.so.6
> >> libm.so (libc6,x86-64, OS ABI: Linux 2.6.4) => /usr/lib64/libm.so
> >> libm.so (libc6, OS ABI: Linux 2.6.4) => /usr/lib/libm.so
> >> which shows that both are included. Does a hello world compile in 32
> >> bits. Works in my case but didn't try anything with so files.
>
> >> In your case ld is still trying to link with libraries from lib64 instead
> >> of your 32 bits libs. A workaround could be to make a symbolic links to
> >> all dependent libraries (find out with ldd). Another possibility is to
> >> chroot everything, ....
> >> taco- Hide quoted text -
>
> >> - Show quoted text -
>
> > Hi,
>
> > Thanks alot for your reply. I am very new to Suse. Can you explain me
> > in detail how can be done with ldd?
>
> > Thank you...
>
> > Regards
> > Satish.
>
> it has nothing to do with suse; ldd prints the dependencies on shared
> libraries which is what you were doing...
> Try to compile first a hello world c program with -m32.
> $gcc -m32 -o hello hello.c>:~/source/hello$./hello
> hello world
> >:~/source/hello$ldd hello
>
> linux-gate.so.1 => (0xffffe000)
> libc.so.6 => /lib/libc.so.6 (0xf7e2b000)
> /lib/ld-linux.so.2 (0xf7f8f000)>:~/source/hello$gcc -o hello hello.c
> >:~/source/hello$ldd hello
>
> libc.so.6 => /lib64/libc.so.6 (0x00002ab1389f8000)
> /lib64/ld-linux-x86-64.so.2 (0x00002ab1387da000)>:~/source/hello$
>
> If you work with a makefile it could be that you use the linker separately.
> There are some problems (I didn't (cross)compile anything until now for 32
> bits, so don't know from own experiences) when using this on 64 platforms.
> ld tries to link 64 bits startup code which results in problems of course.
> try to use only gcc with the -m32 option and use it as linker too (with the
> object file). Check the output with the readelf or file command
> readelf hello
> file hello
> It should give you 32 bits code. If this doesn't work I would suggest to
> move everything in a chroot environment. If you don't know how, you need to
> learn this first from some internet documents.
> Taco- Hide quoted text -
>
> - Show quoted text -

Hi,

Thank you very much!! I feel what you said is correct. I tried by
writing some sample program. Here we build the
libs and provide them to user. Then, will it create same problem with
the user also?

Regards
Satish.
Back to top
TW
External


Since: Jun 28, 2007
Posts: 18



PostPosted: Thu Aug 09, 2007 10:20 am    Post subject: Re: Linking errors in Suse 10 64 bit machine!!!!! please help me!!!! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

satish.lvr.DeleteThis@gmail.com wrote:


>>
>> Hi, What I wrote about ld_library_path is bullshit. sorry. the following
>> is perhaps some help.
>> All 32 bit gcc development tools installed? Check with yast.
>> check if 32 bits libraries come up if you execute /sbin/ldconfig -p
>> For example on my system I get:>/sbin/ldconfig -p|grep libm.so
>>
>> libm.so.6 (libc6,x86-64, OS ABI: Linux 2.6.4) => /lib64/libm.so.6
>> libm.so.6 (libc6, OS ABI: Linux 2.6.4) => /lib/libm.so.6
>> libm.so (libc6,x86-64, OS ABI: Linux 2.6.4) => /usr/lib64/libm.so
>> libm.so (libc6, OS ABI: Linux 2.6.4) => /usr/lib/libm.so
>> which shows that both are included. Does a hello world compile in 32
>> bits. Works in my case but didn't try anything with so files.
>>
>> In your case ld is still trying to link with libraries from lib64 instead
>> of your 32 bits libs. A workaround could be to make a symbolic links to
>> all dependent libraries (find out with ldd). Another possibility is to
>> chroot everything, ....
>> taco- Hide quoted text -
>>
>> - Show quoted text -
>
> Hi,
>
> Thanks alot for your reply. I am very new to Suse. Can you explain me
> in detail how can be done with ldd?
>
> Thank you...
>
> Regards
> Satish.
it has nothing to do with suse; ldd prints the dependencies on shared
libraries which is what you were doing...
Try to compile first a hello world c program with -m32.
$gcc -m32 -o hello hello.c
>:~/source/hello$./hello
hello world
>:~/source/hello$ldd hello
linux-gate.so.1 => (0xffffe000)
libc.so.6 => /lib/libc.so.6 (0xf7e2b000)
/lib/ld-linux.so.2 (0xf7f8f000)
>:~/source/hello$gcc -o hello hello.c
>:~/source/hello$ldd hello
libc.so.6 => /lib64/libc.so.6 (0x00002ab1389f8000)
/lib64/ld-linux-x86-64.so.2 (0x00002ab1387da000)
>:~/source/hello$
If you work with a makefile it could be that you use the linker separately.
There are some problems (I didn't (cross)compile anything until now for 32
bits, so don't know from own experiences) when using this on 64 platforms.
ld tries to link 64 bits startup code which results in problems of course.
try to use only gcc with the -m32 option and use it as linker too (with the
object file). Check the output with the readelf or file command
readelf hello
file hello
It should give you 32 bits code. If this doesn't work I would suggest to
move everything in a chroot environment. If you don't know how, you need to
learn this first from some internet documents.
Taco
Back to top
TW
External


Since: Jun 28, 2007
Posts: 18



PostPosted: Thu Aug 09, 2007 2:53 pm    Post subject: Re: Linking errors in Suse 10 64 bit machine!!!!! please help me!!!! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

> Hi,
>
> Thank you very much!! I feel what you said is correct. I tried by
> writing some sample program. Here we build the
> libs and provide them to user. Then, will it create same problem with
> the user also?
>
> Regards
> Satish.
hi, I would not just provide a customer or "user" the libs without testing
it separately. Install it on a 32 bit box or install a virtual PC with a
normal 32 bits linux version and test if it works. You could use
vmwareplayer or xen or perhaps some spare pc.
taco
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> SUSE All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum