部署使用GCC 4.6编译的OSX应用程序 [英] Deploy OSX application compiled using GCC 4.6

查看:191
本文介绍了部署使用GCC 4.6编译的OSX应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Mac OS-X上尝试移植我的项目。

I'm trying to port a project of mine on Mac OS-X.

当我使用C ++ 0X开发我的项目时,需要更新的版本的GCC比Xcode(甚至Xcode4)提供的那个,所以我编译GCC 4.6在我的雪豹Leopards Mac。

As I developed my project using C++0X I needed a more recent version of GCC than the one provided with Xcode (even Xcode4), so I compiled GCC 4.6 on my Snow Leopards Mac.

我的项目编译良好,它也开始了我编译它的计算机(OS-X 10.6.7),但是当我把它转移到我的MacBook(OS-X 10.5.8)它不工作。

My project does compile fine and it does start too on the computer I compiled it (OS-X 10.6.7) but when I transfer it to my MacBook (OS-X 10.5.8) it doesn't works.

它返回以下错误:


dyld:延迟符号绑定失败:
未找到符号:
__ZNSo9_M_insertImEERSoT_ :
/Users/zu/Desktop/OgreApp.app/Contents/MacOS/OgreApp
预期在:
/ usr / lib / libstdc ++ 6.dylib

dyld: lazy symbol binding failed: Symbol not found: __ZNSo9_M_insertImEERSoT_ Referenced from: /Users/zu/Desktop/OgreApp.app/Contents/MacOS/OgreApp Expected in: /usr/lib/libstdc++.6.dylib

dyld:找不到符号:
__ZNSo9_M_insertImEERSoT_参考资料:
/Users/zu/Desktop/OgreApp.app/Contents/MacOS/OgreApp
预期在:
/ usr / lib / libstdc ++ 6.dylib

dyld: Symbol not found: __ZNSo9_M_insertImEERSoT_ Referenced from: /Users/zu/Desktop/OgreApp.app/Contents/MacOS/OgreApp Expected in: /usr/lib/libstdc++.6.dylib



我理解程序需要libstdc ++ 6.dylib 4.6.0,因为这个文件包含C ++ 0x函数(尽管我当前的测试不使用任何C ++ 0x函数),而不是通常包括在OS-X系统中的标准libstdc ++ 6.dylib。

I understand that the program needs the libstdc++.6.dylib of the GCC 4.6.0 as this file contains the C++0x functions (despite the fact that my current test doesn't use any C++0x function) instead of the standard libstdc++.6.dylib usually included in the OS-X system.

因此,我尝试了以下操作:

So I tried the following:


  • > -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min = 10.5 ,以确保与OS-X 10.5的向后兼容性。但是错误仍然相同。

  • to specify -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 in order to ensure backward compatibility with OS-X 10.5. But the error remains the same.

使用 otool -L 验证libstdc ++ 6.dylib路径并更改共享库路径使用 install_name_tool -change /opt/local/lib/gcc46/libstdc++.6.dylib @executable_path /../ Libraries / libstdc ++ 6.dylib OgreApp (带有gcc 4.6.0的副本libstdc ++ 6.dylib在Libraries文件夹中)建议为。但是错误保持不变。

to verify the libstdc++.6.dylib path using otool -L and changing the shared library path using install_name_tool -change /opt/local/lib/gcc46/libstdc++.6.dylib @executable_path/../Libraries/libstdc++.6.dylib OgreApp (with a copy of the gcc 4.6.0 libstdc++.6.dylib in the Libraries folder) as suggested as answer of my previous question. But the error remains the same.

使用 -static-libgcc - static-libstdc ++ 静态链接libstdc ++和libgcc。但它仍然返回相同的错误。

to statically link libstdc++ and libgcc using -static-libgcc - static-libstdc++. But it still returns the same error.

由于我的程序使用Ogre框架,我应用了上述操作Ogre可执行程序嵌入在Ogre.framework中,但它不会改变任何东西。

As my program use the Ogre framework, I applied the above manipulations to the Ogre executable embedded in the Ogre.framework too, but it doesn't change anything.

有没有人可以解释我应该如何部署一个应用程序创建的非标准libstdc ++在另一台安装了较旧版本的Mac计算机上(我猜这个问题与运行Snow Leopard的计算机相同,因为该程序使用GCC 4.6.0 libstdc ++)?

Does anyone can explain me how I'm supposed to deploy an application created with a non standard libstdc++ on another Mac computer installed with an older version (I guess the problem is the same with a computer running Snow Leopard as the program use the GCC 4.6.0 libstdc++) ?

推荐答案

Mac OS X 10.5不包含GCC标准库的兼容副本。如果你想让你的代码在Leopard上运行,你必须修改它以在旧版本的GCC下编译,否则你必须...好吧,这是你唯一的选择。

Mac OS X 10.5 does not include a compatible copy of the GCC standard library. If you want your code to run on Leopard, you'll have to either modify it to compile under an older version of GCC, or you'll have to... well, really that's your only option.

这篇关于部署使用GCC 4.6编译的OSX应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆