How to build 32 bits boost library on a 64 bits platform

Hello, My platform is a 64 bits Linux with gcc. My program needs to link a 32 bits library without source code and other libraries with source code. I wrote a script to build those libraries with source code by ./configure --prefix=$install_prefix CFLAGS="-g -O2 -Wall -m32" CPPFLAGS=-m32 CXXFLAGS="-g -O2 -m32" make install Then start to build my executable through Makefile with -m32 flag either. The configure and make install work for other libraries but not work for boost. The boost libraries were compiled and installed but still 64 bits. Linker refused to link it. Is there any simple approach to build 32 bits boost on 64 bits Linux? Thanks, Qihong

My platform is a 64 bits Linux with gcc. My program needs to link a 32 bits library without source code and other libraries with source code. I wrote a script to build those libraries with source code by
./configure --prefix=$install_prefix CFLAGS="-g -O2 -Wall -m32" CPPFLAGS=-m32 CXXFLAGS="-g -O2 -m32" make install
Then start to build my executable through Makefile with -m32 flag either. The configure and make install work for other libraries but not work for boost. The boost libraries were compiled and installed but still 64 bits. Linker refused to link it. Is there any simple approach to build 32 bits boost on 64 bits Linux?
on the command line of bjam, you can add: address-model=32 Frédéric Bron Avis : Ce message et toute pièce jointe sont la propriété d'Alcan et sont destinés seulement aux personnes ou à l'entité à qui le message est adressé. Si vous avez reçu ce message par erreur, veuillez le détruire et en aviser l'expéditeur par courriel. Si vous n'êtes pas le destinataire du message, vous n'êtes pas autorisé à utiliser, à copier ou à divulguer le contenu du message ou ses pièces jointes en tout ou en partie. Notice: This message and any attachments are the property of Alcan and are intended solely for the named recipients or entity to whom this message is addressed. If you have received this message in error please inform the sender via e-mail and destroy the message. If you are not the intended recipient you are not allowed to use, copy or disclose the contents or attachments in whole or in part.

On Sat, Mar 21, 2009 at 10:58 PM, Qihong Wang <qihongwang@gmail.com> wrote:
Hello,
My platform is a 64 bits Linux with gcc. My program needs to link a 32 bits library without source code and other libraries with source code. I wrote a script to build those libraries with source code by
./configure --prefix=$install_prefix CFLAGS="-g -O2 -Wall -m32" CPPFLAGS=-m32 CXXFLAGS="-g -O2 -m32" make install
Then start to build my executable through Makefile with -m32 flag either. The configure and make install work for other libraries but not work for boost. The boost libraries were compiled and installed but still 64 bits. Linker refused to link it. Is there any simple approach to build 32 bits boost on 64 bits Linux?
Thanks,
Qihong
Passing 'address-model=32 architecture=x86' arguments to bjam works fine for me. Regards

It works for me. If I just specify address-mode, the library is still 64 bits. I have to specify both. Before I tried this, I also tried to specify gcc version and compileFlag and linkFlag as -m32 according to document. That doesn't work either. Thanks Frédéric and Alexander. On Mon, Mar 23, 2009 at 4:16 AM, Alexander Arhipenko <arhipjan@gmail.com>wrote:
On Sat, Mar 21, 2009 at 10:58 PM, Qihong Wang <qihongwang@gmail.com> wrote:
Hello,
My platform is a 64 bits Linux with gcc. My program needs to link a 32 bits library without source code and other libraries with source code. I wrote a script to build those libraries with source code by
./configure --prefix=$install_prefix CFLAGS="-g -O2 -Wall -m32" CPPFLAGS=-m32 CXXFLAGS="-g -O2 -m32" make install
Then start to build my executable through Makefile with -m32 flag either. The configure and make install work for other libraries but not work for boost. The boost libraries were compiled and installed but still 64 bits. Linker refused to link it. Is there any simple approach to build 32 bits boost on 64 bits Linux?
Thanks,
Qihong
Passing 'address-model=32 architecture=x86' arguments to bjam works fine for me.
Regards _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (3)
-
Alexander Arhipenko
-
frederic.bron@alcan.com
-
Qihong Wang