文件是为 i386 构建的,在 Mac OSX 10.6 上为 iOS 4.2 编译 OpenCV2.2 时,该文件不是链接的架构 (x86_64)

发布于 2024-10-20 10:24:00 字数 1070 浏览 1 评论 0原文

我一直在遵循 http://www.atinfinity.info/wiki/index.php?OpenCV/Using%20OpenCV%202.2%20on%20iOS%20SDK%204.2(它使用我也在http://niw.at/articles/2009/03/14 /using-opencv-on-iphone/en) 编译 OpenCV2.2 以在 iOS 4.2 上运行。一切都很顺利,直到我尝试构建。当我运行以下命令时:

lc:opencv_simulator leonard$ ../opencv_cmake.sh Simulator ../../OpenCV-2.2.0/

我收到以下错误:

ld: warning: in /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/usr/lib/libSystem.dylib,
  file was built for i386 which is not the architecture being linked (x86_64)

这是使用(显然是其他设置):

-D CMAKE_OSX_ARCHITECTURES="i386"

我读到在 OSX 10.6 上 i386 被视为默认值,因此它使用系统默认值(但那是 x86_64)。我还读到我可以使用:

export CFLAGS=-m32
export CPPFLAGS=-m32

但这也不起作用。

有什么想法吗?

I have been following the simple guide at http://www.atinfinity.info/wiki/index.php?OpenCV/Using%20OpenCV%202.2%20on%20iOS%20SDK%204.2 (which uses the older guide I've also read at http://niw.at/articles/2009/03/14/using-opencv-on-iphone/en) to get OpenCV2.2 compiled to work on iOS 4.2. Everything went smoothly until I tried to build. When I run the following:

lc:opencv_simulator leonard$ ../opencv_cmake.sh Simulator ../../OpenCV-2.2.0/

I get the following error:

ld: warning: in /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/usr/lib/libSystem.dylib,
  file was built for i386 which is not the architecture being linked (x86_64)

This is using (among other settings, obviously):

-D CMAKE_OSX_ARCHITECTURES="i386"

I read that on OSX 10.6 i386 is seen as the default, so it uses the system default (but that is x86_64). I also read I could use:

export CFLAGS=-m32
export CPPFLAGS=-m32

But this doesn't work either.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

记忆で 2024-10-27 10:24:00

用于构建特定架构的 gcc 标志是 -march ,如下所示

gcc -march=i386 ...

The gcc flag for building a specific architecture is -march as in

gcc -march=i386 ...
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文