我应该使用 libc++ 还是 libstdc++? [英] Should I use libc++ or libstdc++?

查看:40
本文介绍了我应该使用 libc++ 还是 libstdc++?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 c/c++ 为 osx 和 linux 开发命令行界面可执行文件.该项目将链接到 opencv.我应该使用 libc++ 还是 libstdc++?

I am developing command line interface executables for both osx and linux using c/c++. The project will link against opencv. Should I use libc++ or libstdc++?

推荐答案

我会为每个操作系统使用原生库,即 GNU/Linux 上的 libstdc++ 和 Mac OS X 上的 libc++.

I would use the native library for each OS i.e. libstdc++ on GNU/Linux and libc++ on Mac OS X.

libc++ 在 GNU/Linux 上不是 100% 完整的,当 libstdc++ 更完整时,使用它并没有真正的优势.此外,如果您想链接到任何其他用 C++ 编写的库,它们几乎肯定是用 libstdc++ 构建的,因此您也需要与之链接才能使用它们.

libc++ is not 100% complete on GNU/Linux, and there's no real advantage to using it when libstdc++ is more complete. Also, if you want to link to any other libraries written in C++ they will almost certainly have been built with libstdc++ so you'll need to link with that too to use them.

此处了解有关 libc++ 在各种平台上的完整性的更多信息.

More info here about the completeness of libc++ on various platforms.

这篇关于我应该使用 libc++ 还是 libstdc++?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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