在 OSX 上使用 i386 arch 而非 x86_64 构建 libFLAC [英] Building libFLAC on OSX with i386 arch not x86_64
问题描述
我正在尝试构建 libFLAC 以在我的项目中使用,但是在链接方面,GCC 忽略了该库,因为它说它不是为当前架构 (i386) 构建的.当我以 64 位编译程序时,它正确链接了库,这意味着该库是为 x86_64 架构编译的.不幸的是,我的程序不能在 64 位上运行,所以我需要将 libFLAC 编译为 i386.我试过使用 ./configure --build=i386 但它似乎没有改变任何东西.
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.
到目前为止,我一直在这样做:
./configure --disable-asm-optimizations --build=i386
制作
须藤制作安装
So far, I've simply been doing this:
./configure --disable-asm-optimizations --build=i386
make
sudo make install
但它似乎总是为 x86_64 构建.
But it always seems to build for x86_64.
有谁知道我如何强制它为特定架构编译?
Does anyone know how I can force it to compile for a certain architecture?
推荐答案
逐字逐句来自我的评论:
Verbatim from my comment:
试试 ./configure CFLAGS='-arch i386'
.您可能还需要其他 CFLAGS
,但请尝试一下.
Try ./configure CFLAGS='-arch i386'
. You might need other CFLAGS
as well, but give it a try.
这篇关于在 OSX 上使用 i386 arch 而非 x86_64 构建 libFLAC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!