简体   繁体   中英

Building 32-bit FCGI++ binaries in 64-bit environment in Ubuntu 13

Good afternoon.

I'm trying to build 32-bit fcgi++ binaries under my 64-bit env. I configured FCGI++ in the following way:

CC="gcc -m32" ./configure 

After typing 'make' I see the some building process and the following errors at the end (snippet is here):

gcc -m32 -shared fcgio.lo -Wl,--rpath -Wl,/home/eotovchits/Downloads/fcgi/fcgi-2.4.1-SNAP-0311112127/libfcgi/.libs -Wl,--rpath -Wl,/usr/local/lib /home/eotovchits/Downloads/fcgi/fcgi-2.4.1-SNAP-0311112127/libfcgi/.libs/libfcgi.so -Wl,-soname -Wl,libfcgi++.so.0 -o .libs/libfcgi++.so.0.0.0 /usr/bin/ld: i386:x86-64 architecture of input file fcgio.lo' is incompatible with i386 output fcgio.lo: In function __static_initialization_and_destruction_0': /usr/include/c++/4.8/iostream:74: undefined reference to std::ios_base::Init::Init()' /usr/include/c++/4.8/iostream:74: undefined reference to std::ios_base::Init::~Init()'

...................... a lot of similar lines ...........................

fcgio.lo: In function ~basic_ios': /usr/include/c++/4.8/bits/basic_ios.h:276: undefined reference to vtable for std::basic_ios >' /usr/include/c++/4.8/bits/basic_ios.h:276: undefined reference to std::ios_base::~ios_base()' /usr/include/c++/4.8/bits/basic_ios.h:276: undefined reference to vtable for std::basic_ios >' /usr/include/c++/4.8/bits/basic_ios.h:276: undefined reference to std::ios_base::~ios_base()' fcgio.lo: In function fcgi_istream::~fcgi_istream()': /home/eotovchits/Downloads/fcgi/fcgi-2.4.1-SNAP-0311112127/libfcgi/../include/fcgio.h:120: undefined reference to `operator delete(void*)' /usr/bin/ld: fcgio.lo: file class ELFCLASS64 incompatible with ELFCLASS32 /usr/bin/ld: final link failed: File in wrong format collect2: error: ld returned 1 exit status

I assume that I need some additional 32-bits building environment to make the 32-bits binaries (along w/ all the needed 3rd-party libraries, .as and .so-s)

Do you know how can i set up such environment locally along with native 64-bit environment and build my fcgi++ binaries for 32-bits environment?

Thank you.

on Ubuntu you can install the libraries for i386 along the x64 ones by appending":i386" at the end oh the name of the package you want to install (assuming you are using apt-get to install the lib).

here is an example of how to do it:

https://askubuntu.com/questions/60751/is-it-possible-to-have-32-bit-libraries-installed-on-a-64-bit-system

And here how to install the compiler for 32 bits (well the STL and other stuff):

http://en.kioskea.net/faq/1137-compiling-testing-in-32-bit-on-ubuntu-x86-64

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM