Solved

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

Posted on 2006-06-26
4
291 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:
Kdo earned 250 total points
Comment Utility

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
Comment Utility
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:Kdo
Comment Utility

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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
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 opening and reading files in the C programming language.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now