Building 32b linux on 64b Linux

Nocturnal

Well-known member
Hi,

I got Fedora 13 working fine under Virtualbox. Guest additions work almost all the way, I can work in native monitor resolution and I can mount my NAS shares as samba shares. I can access my NAS cvsroot so I can edit my sources. Got g++ installed (gcc 4.4 was already there but g++ was not and was able to modify the linux makefiles to work in my environment. The 64b build of my module worked fine and PI happily loaded the module. The 32b install did not work though:

[sander@hercules-fedora g++]$ make
make -f ./makefile-x86 --no-print-directory
mkdir -p "/home/sander/Desktop/Profile/linux/g++/x86/Release"
g++ -m32 -Wl,-O1 -shared -L"/home/sander/pcl32/lib/x86" -L"/home/sander/pcl32/bin" -o "/home/sander/Desktop/Profile/linux/g++/x86/Release"/Profile-pxm.so ./x86/Release/ProfileInstance.o ./x86/Release/ProfileInterface.o ./x86/Release/ProfileModule.o ./x86/Release/ProfileParameters.o ./x86/Release/ProfileProcess.o -lpthread -lPCL-pxi
/usr/bin/ld: crti.o: No such file: No such file or directory
collect2: ld returned 1 exit status
make[1]: *** ["/home/sander/Desktop/Profile/linux/g++/x86/Release"/Profile-pxm.so] Error 1
make: *** [all] Error 2
[sander@hercules-fedora g++]$ ls /home/sander/pcl32/lib/x86
libPCL-pxi.a
[sander@hercules-fedora g++]$

As you can see I have pcl64 installed under $HOME/pcl and pcl32 under home/pcl32. Environment vars seem to be fine judging by the messages above. So it seems I need a 32b runtime library to link my module. I was able to make some progress by installing these:

  71  yum install gcc-c++ make
  73  yum install glibc-devel.i386
  75  yum install glibc.i686
  76  yum install glibc-devel.i686


The errors are now reduced to:

[sander@hercules-fedora g++]$ make -f makefile-x86
mkdir -p "/home/sander/Desktop/Profile/linux/g++/x86/Release"
g++ -m32 -Wl,-O1 -shared -L"/home/sander/pcl32/lib/x86" -L"/home/sander/pcl32/bin" -o "/home/sander/Desktop/Profile/linux/g++/x86/Release"/Profile-pxm.so ./x86/Release/ProfileInstance.o ./x86/Release/ProfileInterface.o ./x86/Release/ProfileModule.o ./x86/Release/ProfileParameters.o ./x86/Release/ProfileProcess.o -lpthread -lPCL-pxi
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.4.4/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.4.4/libstdc++.a when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.4.4/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.4.4/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
make: *** ["/home/sander/Desktop/Profile/linux/g++/x86/Release"/Profile-pxm.so] Error 1
[sander@hercules-fedora g++]$

 
This should do the trick:

Code:
yum install libstdc++.i686

BTW, avoid .i386 packages. All 32-bit packages are now .i686 as of Fedora 12/13 AFAIK.

yum has a very nice feature with the 'provides' argument. For example:

Code:
yum provides libstdc++

tells you which packages provide the required library.
 
Back
Top