'ext / slist'文件在OS X 10.9上找不到 [英] 'ext/slist' file not found on OS X 10.9

查看:642
本文介绍了'ext / slist'文件在OS X 10.9上找不到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想尝试在OS X 10.9上编译一些旧的第三方软件。我设法通过调整Makefile中的设置摆脱了大多数编译问题,这是最初写于 gcc 大约在2005年左右。但是,我目前不知道如何克服这个错误为一个C ++源文件:


/utility.h:42:10:fatal错误:未找到'ext / slist'

我理解 ext / slist 属于 STL 。该版本已被取代,或者必须以任何特殊方式激活Apple版本的Clang / LLVM (5.0 for OS X 10.9)?



如果可能的话,我希望使用预先安装的工具编译此软件,而不要执行安装 通过MacPorts



BTW,这些警告也会持续:


/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain /usr/bin/../lib/c++/v1/ext/hash_set:202:2:
warning:
不推荐使用标题。迁移到
[-W#warnings] /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ext/hash_map:209:2:
warning:
不推荐使用头。迁移到
[-W#warnings]



解决方案

Slist列表,并且是libstdc ++中包含的扩展。 Mac OS X已经从libstdc ++转向libc ++,它提供了一个C ++ 11标准库。 C ++ 11在标题< forward_list> 中的名称std :: forward_list下提供了一个单独链接的列表。

我相信libstdc ++仍然包含在开发工具中,所以你也可以将你的项目切换回来。如果您使用的是Xcode项目,您可以在构建设置中选择该库,或者确保该程序使用-stdlib = libstdc ++


构建

I am trying to get some older third-party software to compile on OS X 10.9. I've managed to get rid of most compilation problems by adjusting settings in the Makefiles, which were originally written for gcc probably around 2005. However, I currently don't know how to overcome this error for a C++ source file:

/utility.h:42:10: fatal error: 'ext/slist' file not found

I understand that ext/slist belongs to some version of STL. Has that version been superseded or does it have to be activated in any special way for Apple's version of Clang/LLVM (5.0 for OS X 10.9)?

If at all possible, I would prefer to compile this software with the pre-installed tools and not go through such steps as installing gcc via MacPorts.

BTW, these warnings also persist:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ext/hash_set:202:2: warning: Use of the header is deprecated. Migrate to [-W#warnings] /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ext/hash_map:209:2: warning: Use of the header is deprecated. Migrate to [-W#warnings]

解决方案

Slist is a singly linked list and was an extention included in libstdc++. Mac OS X has been moving away from libstdc++ toward libc++, which provides a C++11 standard library. C++11 provides a singly linked list under the name std::forward_list in the header <forward_list>.

I believe libstdc++ is still included in the developer tools, so you may also be able to switch your project back to that. If you're using an Xcode project you can select the library in the build settings, or ensure that the program is getting built with -stdlib=libstdc++

这篇关于'ext / slist'文件在OS X 10.9上找不到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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