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

Posted on 2006-06-26
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, 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:, needed by $(GP2XDEV)/X11R6/lib/, 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?
Question by:bpmurray
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
  • 2
  • 2
LVL 45

Accepted Solution

Kent Olsen earned 250 total points
ID: 16984504

This looks like a fairly common 64-bit/32-bit conflict error.  You probably have (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.


LVL 15

Author Comment

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.
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.

LVL 15

Author Comment

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.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
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 nested-loops in the C programming language.

749 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