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
Solved

Problems resolving names in ld, even though libs specified  in -L

Posted on 2006-06-26
4
299 Views
Last Modified: 2010-04-15
I'm trying to build a package, using configure, and it all works fine with the single exception of the X libraries. There's a step to locate the libXtst.so, and the line:

gp2x-gcc -o conftest -O3 -Wall --fast-math -I$(GP2XDEV)/gp2x/include -I$(GP2XDEV)/include -lpthread -ldl conftest.c -lXtst  -L$(GP2XDEV)/X11R6/lib -L$(GP2XDEV)/lib -L$(GP2XDEV)/gp2x/lib >&5


fails with a bunch of messages which are of the form:

$(GP2XDEV)/lib/gcc/gp2x/4.0.2/../../../../gp2x/bin/ld: warning: libXext.so.6, needed by $(GP2XDEV)/X11R6/lib/libXtst.so, not found (try using -rpath or -rpath-link)

When I update my LDFLAGS to include -Xlinker -rpath -Xlinker $(GP2XDEV)/X11R6/lib, I still get the error. Any ideas?

FYI: using gcc 4.0.2, ld 2.16.91 and kdrive X libs, cross-compiling for GP2X handheld. I don't think these are the cause of the problem: I think it's some linker option(s) that I haven't managed to set.

Edit: I'm not even sure that C is the right place to host this question ... perhaps platforms/Linux would be better?
0
Comment
Question by:bpmurray
  • 2
  • 2
4 Comments
 
LVL 45

Accepted Solution

by:
Kent Olsen earned 250 total points
ID: 16984504

This looks like a fairly common 64-bit/32-bit conflict error.  You probably have libXext.so.5 (or other version) in /usr/lib but not .6.  See if it is in the filesystem anywhere and create a link to it from /usr/lib.

Is the file there?  If it's not there you'll have to install it.


Kent

0
 
LVL 15

Author Comment

by:bpmurray
ID: 16984559
All the libs are present & accounted for. The X libs are in the X11R6/lib dir which is included as a -L param. Do you think I should link from /usr/lib to these, even though they should be visible by virtue of the -L? BTW, I also tried LD_RUN_PATH and that didn't work either.
0
 
LVL 45

Expert Comment

by:Kent Olsen
ID: 16984581

Links are easy to create and delete.  :)   It can't hurt to try.

BTW, I find these 64/32 bit conflicts a complete PITA.  I'll certainly be glad when the 64 bit environments are more complete.


Kent
0
 
LVL 15

Author Comment

by:bpmurray
ID: 16984744
Found it! Your idea about it being in /usr/lib pushed me to thinking about how it might find the libs. I simply changed the use of -rpath <dir> to -rpath-link <dir-list> and it found the libs.
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
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.

828 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