简体   繁体   English

在xcode中将boost库添加到cocos2d-x项目吗?

[英]Adding boost library to cocos2d-x project in xcode?

I've stumbled upon a problem trying to build a cross-platform app using cocos2d-x. 我偶然发现了一个尝试使用cocos2d-x构建跨平台应用程序的问题。 Currently I'm trying to build for Mac OSX. 目前,我正在尝试针对Mac OSX进行构建。 I've tried linking to the boost header files but I keep getting errors stating boost/shared_ptr.hpp cannot be found. 我尝试链接到boost头文件,但是我不断收到错误消息,指出找不到boost / shared_ptr.hpp。 I'm only using the smart pointer headers. 我只使用智能指针头。

I've added the root boost directory to Header Search Paths: $(SRCROOT)/../../boost_1_55_0 (non-recursive) and the libs directory to Library Search Paths: $(SRCROOT)/../../boost_1_55_0/libs (non-recursive) 我已将root boost目录添加到Header Search Paths:$(SRCROOT)/../../ boost_1_55_0(非递归),将libs目录添加到Library Search Paths:$(SRCROOT)/../../ boost_1_55_0 / libs(非递归)

  • I tried this for both the root project file and cocos2d_libs project file with no good results. 我对根项目文件和cocos2d_libs项目文件都尝试了此操作,但效果不佳。
  • I also tried adding to User Header Search Paths. 我也尝试添加到用户标题搜索路径。

I've added them successfully on an SFML project, so does cocos2d-x bypass these search paths? 我已将它们成功添加到SFML项目中,那么cocos2d-x会绕过这些搜索路径吗?

Thanks to anyone who is willing to help me! 感谢任何愿意帮助我的人!

Probably you have missed some step in your setup. 可能您错过了设置步骤。 Have a double check on every detail as you can go through these guidelines: 请仔细检查每个细节,以遵循以下准则:

This should help, as attention to detail if worthwhile. 这应该有所帮助,因为如果值得的话,请注意细节。

I never figured out the problem, but I realise now that there's no need to even use boost. 我从来没有想过这个问题,但现在我意识到甚至不需要使用boost。 Cocos2d-x is compatible with C++11. Cocos2d-x与C ++ 11兼容。 What a relief. 终于解脱了。

Since XCode builds Cocos2DX projects for Mac and iOS you need to setup header search paths independently. 由于XCode为Mac和iOS构建Cocos2DX项目,因此您需要独立设置标题搜索路径。 Just switch target in XCode from iOS to Mac and set path to Boost for Mac build. 只需将XCode中的目标从iOS切换到Mac,并将路径设置为Boost for Mac构建即可。 Should work. 应该管用。

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

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