LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Tags used in this thread
Popular LQ Tags , , ,

Reply
 
Thread Tools
Old 04-24-2007, 01:57 PM   #1
marier
LQ Newbie
 
Registered: Aug 2005
Posts: 2
Thanked: 0
32/64 bit libs - FC6/gcc 4.1.1 -m32 picking up 64 bit library


[Log in to get rid of this advertisement]
Dear LQ Folks,

gcc's linker appears to be picking up 64 bit libraries in spite of specifying a 32 bit architecture. I am compiling a small program with a call to a libX11 function (see bottom). Compiling with gcc 4.1.1/ld 2.17.50.06-2.fc6, I am seeing the following:

> gcc -m32 -o testit testit.c -lX11
/usr/bin/ld: skipping incompatible /usr/lib64/libX11.so when searching for -lX11
/usr/bin/ld: cannot find -lX11
collect2: ld returned 1 exit status


It appears that in spite of the -m32 flag to gcc the 64 bit library is being picked up. The 32 bit libraries are installed and linking manually works fine:

> gcc -m32 -o testit testit.c /usr/lib/libX11.so.6
>


Using the -print-file-name option of gcc indicates that libX11.so.6 should be taken from the 32 bit library directories:

> gcc -print-file-name=libX11.so.6 -m32 -o testit testit.c -lX11
/usr/lib/gcc/x86_64-redhat-linux/4.1.1/../../../../lib/libX11.so.6


Accounting for the parent directory links, the above file maps to /usr/lib/libX11.so.6 which is the library that I successfully manually linked above. Any ideas on what the problem might be?

Thanks for any help that anyone might offer,
Marie

testit.c ------------------------------------------
/* tesit.c taken from Chris Siebermann's blog
* http://utcc.utoronto.ca/~cks/space/b...singSoSymlinks
*/

#include <X11/Xlib.h>
#include <X11/Xutil.h>
int main(void) {
(void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0);
return 0;
}
marier is offline  
Tag This Post , , ,
Reply With Quote

Reply

Bookmarks


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JDK 1.6.0 32-bit and 64-bit on Same System (FC6)? sancho Fedora 3 01-23-2007 07:20 AM
Upgrade from 32 bit to 64 bit (FC5 to FC6) ocgltd Fedora 1 11-05-2006 07:03 PM
32 bit or 64 bit install - is 32 bit easier for a newbie? dms05 Linux - Newbie 3 05-19-2006 04:05 PM
64 bit vs. 32 bit libs and rpm hcastro Linux - Software 0 06-17-2005 03:22 PM
32 bit emulation libs on 64 bit system csfalcon Linux - Software 1 12-23-2004 01:49 AM


All times are GMT -5. The time now is 11:38 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration