Solved

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

Posted on 2006-06-26
4
293 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
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:Kdo
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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
pgpool-II on Ubuntu 14.04... ARGH! 5 843
Why adding test code changes the build ? 11 130
Pointer in one class to member in another 6 116
Line meaning 9 82
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…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand and use pointers 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.

920 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

16 Experts available now in Live!

Get 1:1 Help Now