问题
I'm trying to build libFLAC to use in a project of mine, however when it comes to linking, GCC ignores the library because it says it was not built for the current architecture (i386). When I compile the program in 64-bit, it links the library properly which means the library was compiled for x86_64 architecture. Unfortunately, my program wont work in 64-bit, so I need to compile libFLAC as i386. I've tried using ./configure --build=i386 however it didn't seem to change anything.
So far, I've simply been doing this:
./configure --disable-asm-optimizations --build=i386
make
sudo make install
But it always seems to build for x86_64.
Does anyone know how I can force it to compile for a certain architecture?
回答1:
Verbatim from my comment:
Try ./configure CFLAGS='-arch i386'
. You might need other CFLAGS
as well, but give it a try.
来源:https://stackoverflow.com/questions/7342099/building-libflac-on-osx-with-i386-arch-not-x86-64