简体   繁体   English

Boost #include在XCode上失败,即使boost在标题搜索路径上也是如此

[英]Boost #include is failing on XCode even though boost is on the header search path

I have a copy of boost installed at /usr/local/ogre/ogre1.8/iOSDependencies/include : 我在/usr/local/ogre/ogre1.8/iOSDependencies/include安装了boost的副本:

在此处输入图片说明

... ...

在此处输入图片说明

In XCode, a cpp file is failing to compile because a file it includes has a line: 在XCode中,cpp文件无法编译,因为它包含的文件包含一行:

#include <boost/thread/tss.hpp>

The XCode compile cmdline to CompileC includes XCode编译cmdline到CompileC包括

-I/usr/local/ogre/ogre1.8/iOSDependencies/include

Everything looks just fine to me... <boost/...> is a child of /usr/local/ogre/ogre1.8/iOSDependencies/include and thread/tss.hpp clearly exists. 一切对我来说都很好... <boost/...>/usr/local/ogre/ogre1.8/iOSDependencies/include的子代,线程/tss.hpp显然存在。 Why would XCode think otherwise? XCode为什么会这样认为呢? I tried a clean build without any success. 我尝试了一个干净的版本,但没有成功。

The XCode project settings look like this: XCode项目设置如下所示:

在此处输入图片说明

fatal error: 'boost/thread/tss.hpp' file not found #include <boost/thread/tss.hpp> fatal error: 'boost/thread/tss.hpp' file not found #include <boost/thread/tss.hpp>

" First, you must have compiled boost on iPhone using the code and instructions from the boostoniphone project. “首先,您必须使用boostoniphone项目的代码和指令在iPhone上编译了boost。

Navigate within the "boostoniphone" folder to the "framework" folder. 在“ boostoniphone”文件夹中导航到“ framework”文件夹。 Click on the "boost.framework" folder in that location, and drag it into the main xcode window, in the left hand side column, into the "frameworks" group (along with all the other frameworks, ie Foundation.framework, UIKit.framework, etc.) 单击该位置上的“ boost.framework”文件夹,并将其拖到xcode主窗口的左侧列中的“ frameworks”组(以及所有其他框架,即Foundation.framework,UIKit)中。框架等)

That's it. 而已。 If you added any build settings while trying to get this to work,remove them." 如果您在尝试使其正常工作时添加了任何构建设置,请删除它们。”

The above is the answer I found after some research. 以上是我经过研究发现的答案。 Please comment on my answer if it did help you solve your issue. 如果确实能帮助您解决问题,请评论我的答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM