Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 05-26-2006, 05:14 AM   #1
LQ Newbie
Registered: May 2006
Posts: 2

Rep: Reputation: 0
compiling in 32-bit mode on 64-bit Linux

Hello everyone,

I am using some hardware (haptic device), whose Linux drivers come only in 32-bit binary form (i.e.: no source code), which, in order to integrate with my other software, entails that I compile everything else in 32-bit format as well. Currently, however, I am using Suse 10 configured in 64-bit format. I need the 64 bits for other applications of mine, namely image processing of CT volumes that easily eats up more than 2 Gb.

I am using gcc 4.0.2. Is there a way of ensuring that my former compilation entirely takes place in 32 bits? So far, I am seeing the following:

gcc -W -O2 -DNDEBUG -Dlinux -o HelloHapticDevice HelloHapticDevice.c conio.c -L/usr/lib -lHDU -lHD -lrt
HelloHapticDevice.c:40: warning: ‘stdcall’ attribute ignored
HelloHapticDevice.c:115: warning: ‘stdcall’ attribute ignored
/var/tmp/dirinstall/usr/bin/ld: skipping incompatible /usr/lib/ when searching for -lHD
/var/tmp/dirinstall/usr/bin/ld: skipping incompatible /usr/lib/ when searching for -lHD
/var/tmp/dirinstall/usr/bin/ld: cannot find -lHD
collect2: ld returned 1 exit status

I have tried an instruction of the type
CC=linux32 gcc
in the Makefile, to no avail.

Please advise,

Old 05-26-2006, 07:15 AM   #2
Registered: Jul 2005
Location: USA
Distribution: F10 (x86_64)
Posts: 549

Rep: Reputation: 32
The flags I use on fc5 to compile in 32 bit are
CC="gcc m32"

However, to get to the point of compiling you will need a bunch of 32 bit -devel libs to get the job done.
Old 05-26-2006, 08:39 AM   #3
LQ Newbie
Registered: May 2006
Posts: 2

Original Poster
Rep: Reputation: 0
Hi Jlo,

that turned out to be surprisingly easy. Thank you for the prompt, accurate and concise answer.

Michel (GME)


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
compiling 64 bit kernel in 32 bit linux MadnessASAP Linux - Hardware 6 05-04-2009 12:47 PM
compiling on ia64 in 32 bit mode nkshirsagar SUSE / openSUSE 2 05-05-2005 01:47 AM
Compiling 32-bit binary in a 64-bit environment Kaj Linux - Software 1 12-13-2004 10:43 AM
32 bit or 16 bit mode in XF86Config-4 uglydot Linux - Hardware 4 06-25-2003 03:07 PM
Displaying 8-bit images in 24-bit mode and vice versa yrraja Linux - General 4 04-30-2003 12:54 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:02 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
Open Source Consulting | Domain Registration