LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   compiling in 32-bit mode on 64-bit Linux (https://www.linuxquestions.org/questions/linux-software-2/compiling-in-32-bit-mode-on-64-bit-linux-448691/)

germanymontrealexpat 05-26-2006 04:14 AM

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:

make
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/libHD.so when searching for -lHD
/var/tmp/dirinstall/usr/bin/ld: skipping incompatible /usr/lib/libHD.so 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,

GME

jlo_sandog 05-26-2006 06:15 AM

The flags I use on fc5 to compile in 32 bit are
CC="gcc m32"
LDFLAGS='-L/usr/X11R6/lib'

However, to get to the point of compiling you will need a bunch of 32 bit -devel libs to get the job done.

germanymontrealexpat 05-26-2006 07:39 AM

Hi Jlo,

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

Michel (GME)


All times are GMT -5. The time now is 07:15 PM.