2015-04-01 46 views
9

有沒有人成功地在Boost pod上使用Cocoapods?如何在IOS上使用Cocoapods的Boost?

我不明白它似乎並沒有完全安裝。在pod安裝到一個空白項目後,我會看到下面的內容。有沒有我失蹤的一步?

enter image description here

這是我的輸出裝

吊艙安裝--verbose

Analyzing dependencies 

Updating spec repositories 
    $ /Applications/XCode.app/Contents/Developer/usr/bin/git rev-parse >/dev/null 2>&1 
    $ /Applications/XCode.app/Contents/Developer/usr/bin/git rev-parse >/dev/null 2>&1 
Updating spec repo `master` 
    $ /Applications/XCode.app/Contents/Developer/usr/bin/git pull --ff-only 
    Already up-to-date. 

CocoaPods 0.36.3 is available. 
To update use: `gem install cocoapods` 

For more information see http://blog.cocoapods.org 
and the CHANGELOG for this version http://git.io/BaH8pQ. 


Inspecting targets to integrate 
    Using `ARCHS` setting to build architectures of target `Pods`: (``) 
    Using `ARCHS` setting to build architectures of target `Pods-PodBoost`: (``) 

Resolving dependencies of `Podfile` 
Starting resolution (2015-04-01 15:48:56 +0300) 
Creating possibility state for boost (~> 1.57) (1 remaining) 
    Attempting to activate boost (1.57.0) 
    Activated boost at boost (1.57.0) 
    Requiring nested dependencies (boost/string_algorithms-includes (= 1.57.0), boost/shared_ptr-includes (= 1.57.0), boost/pointer_cast-includes (= 1.57.0), boost/numeric-includes (= 1.57.0), boost/preprocessor-includes (= 1.57.0), boost/math-includes (= 1.57.0), boost/graph-includes (= 1.57.0)) 
    Creating possibility state for boost/string_algorithms-includes (= 1.57.0) (1 remaining) 
    Attempting to activate boost/string_algorithms-includes (1.57.0) 
    Activated boost/string_algorithms-includes at boost/string_algorithms-includes (1.57.0) 
    Requiring nested dependencies() 
    Creating possibility state for boost/shared_ptr-includes (= 1.57.0) (1 remaining) 
     Attempting to activate boost/shared_ptr-includes (1.57.0) 
     Activated boost/shared_ptr-includes at boost/shared_ptr-includes (1.57.0) 
     Requiring nested dependencies() 
     Creating possibility state for boost/pointer_cast-includes (= 1.57.0) (1 remaining) 
     Attempting to activate boost/pointer_cast-includes (1.57.0) 
     Activated boost/pointer_cast-includes at boost/pointer_cast-includes (1.57.0) 
     Requiring nested dependencies() 
     Creating possibility state for boost/numeric-includes (= 1.57.0) (1 remaining) 
      Attempting to activate boost/numeric-includes (1.57.0) 
      Activated boost/numeric-includes at boost/numeric-includes (1.57.0) 
      Requiring nested dependencies() 
      Creating possibility state for boost/preprocessor-includes (= 1.57.0) (1 remaining) 
      Attempting to activate boost/preprocessor-includes (1.57.0) 
      Activated boost/preprocessor-includes at boost/preprocessor-includes (1.57.0) 
      Requiring nested dependencies() 
      Creating possibility state for boost/math-includes (= 1.57.0) (1 remaining) 
       Attempting to activate boost/math-includes (1.57.0) 
       Activated boost/math-includes at boost/math-includes (1.57.0) 
       Requiring nested dependencies() 
       Creating possibility state for boost/graph-includes (= 1.57.0) (1 remaining) 
       Attempting to activate boost/graph-includes (1.57.0) 
       Activated boost/graph-includes at boost/graph-includes (1.57.0) 
       Requiring nested dependencies() 
Finished resolution (8 steps) (Took 0.007472 seconds) (2015-04-01 15:48:56 +0300) 
Unactivated: 
Activated: boost, boost/string_algorithms-includes, boost/shared_ptr-includes, boost/pointer_cast-includes, boost/numeric-includes, boost/preprocessor-includes, boost/math-includes, boost/graph-includes 

Comparing resolved specification to the sandbox manifest 
    A boost 

Downloading dependencies 

-> Installing boost (1.57.0) 
> Http download 
    $ /usr/bin/curl -f -L -o /Users/ryanheitner/Projects/PodBoost/Pods/boost/file.tgz "http://sourceforge.net/projects/boost/files/boost/1.57.0/boost_1_57_0.tar.gz" --create-dirs 
    % Total % Received % Xferd Average Speed Time Time  Time Current 
            Dload Upload Total Spent Left Speed 
    0 353 0  0 0  0  0  0 --:--:-- --:--:-- --:--:--  0 
    0 423 0  0 0  0  0  0 --:--:-- --:--:-- --:--:--  0 
    0 337 0  0 0  0  0  0 --:--:-- 0:00:01 --:--:--  0 
100 70.0M 100 70.0M 0  0 2744k  0 0:00:26 0:00:26 --:--:-- 3007k 
    $ /usr/bin/tar xfz /Users/ryanheitner/Projects/PodBoost/Pods/boost/file.tgz -C /Users/ryanheitner/Projects/PodBoost/Pods/boost 
    - Running pre install hooks 

Generating Pods project 
    - Creating Pods project 
    - Adding source files to Pods project 
    - Adding frameworks to Pods project 
    - Adding libraries to Pods project 
    - Adding resources to Pods project 
    - Linking headers 
    - Installing targets 
    - Installing target `Pods-PodBoost` iOS 8.2 
    - Running post install hooks 
    - Writing Xcode project file to `Pods/Pods.xcodeproj` 
    - Writing Lockfile in `Podfile.lock` 
    - Writing Manifest in `Pods/Manifest.lock` 
+0

假設你沒有打斷由於一大堆文件而導致的冗長安裝過程,你的答案如下。 – SwiftArchitect 2015-08-13 22:20:32

回答

2

爲什麼沒有列出波德?

這是一個boost的神器,它不是一個Xcode項目,只是一組文件。另外,你會發現內部目錄boost正確地位於${PODS_ROOT}/boost的內部,引用於標題搜索路徑構建設置。這是你使用Pod獲得的。

波德&升壓層次

boost../Pods/boost/boost嵌套需要允許在庫中的文件稱自己爲:

#include "boost/date_time/posix_time/posix_time_config.hpp" 

如果讓操作完成:(該boost庫壓縮時大小超過100 MB)

Downloading dependencies 
Installing boost (1.57.0) 
Generating Pods project 
Integrating client project 

... while y OU沒有看到它在你的項目,你會發現它是在源代碼樹:

enter image description here

你可以引用它:

#import "boost/date_time.hpp" 

,並開始處理其他緊迫問題,如定位#include <cstdlib>,這完全是另一個話題。

的Objective-C++編譯

爲了編譯boost,這是一個C++庫,你需要從C++源文件(不ç來源,這是默認明確提到它在.m中),或採用compiling a C++ class in Xcode: error during compilation: stl vector中列出的替代解決方案。

.mm文件,包括這兩個測試線:

#include <cstdlib> // Proof of concept 
#import "boost/date_time.hpp" 

對於此示例的目的,我已更名main.mmain.mm。 由於Pod沒有進口任何.ipp文件,你可以在預處理宏構建設置添加NO_BOOST_DATE_TIME_INLINE=1。這樣做,您將獲得大約十幾個警告,如下所示,並且成功完成編譯,而無需手動導入。

隱式轉換失去整數精度: '長' 到 'hour_type'(又名 'INT')


編輯:刪除的題外話手動導入,不需要


+1

我跟着你的指令,然後當我添加#import「boost/date_time.hpp」到我的MyObject.mm文件時,它在gregorian_calendar.hpp中失敗,#include「boost/date_time/gregorian_calendar.ipp」文件未找到 – 2015-08-16 06:55:01

+0

讓我明白這個。你需要刪除(刪除引用)來提升,然後重新添加回項目作爲非Pod?看起來,使用boost.framework是一條路,Cocoapods不適合這樣一個大型圖書館。 – 2015-08-17 06:17:34

+0

我真的不知道是否接受你的答案。我很感謝你們付出的努力,但我不確定是否有更令人滿意的答案。 – 2015-08-18 06:45:09

相關問題