Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Fedora This forum is for the discussion of the Fedora Project.


  Search this Thread
Old 04-24-2007, 12:57 PM   #1
LQ Newbie
Registered: Aug 2005
Posts: 2

Rep: Reputation: 0
32/64 bit libs - FC6/gcc 4.1.1 -m32 picking up 64 bit library

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, I am seeing the following:

> gcc -m32 -o testit testit.c -lX11
/usr/bin/ld: skipping incompatible /usr/lib64/ 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/

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

> gcc -m32 -o testit testit.c -lX11

Accounting for the parent directory links, the above file maps to /usr/lib/ 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,

testit.c ------------------------------------------
/* tesit.c taken from Chris Siebermann's blog

#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;


32bit, gcc, libraries, x8664

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 06:20 AM
Upgrade from 32 bit to 64 bit (FC5 to FC6) ocgltd Fedora 1 11-05-2006 06:03 PM
32 bit or 64 bit install - is 32 bit easier for a newbie? dms05 Linux - Newbie 3 05-19-2006 03:05 PM
64 bit vs. 32 bit libs and rpm hcastro Linux - Software 0 06-17-2005 02:22 PM
32 bit emulation libs on 64 bit system csfalcon Linux - Software 1 12-23-2004 12:49 AM

All times are GMT -5. The time now is 12:53 PM.

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