2015-04-01 3 views
9

Неужели кому-нибудь удалось использовать Cocoapods с Boost pod?Как использовать Boost с Cocoapods на IOS?

Я не понимаю, что он, похоже, не установлен полностью. После установки 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

ответ

2

Почему Pod нет в списке?

Это артефакт boost, не являющийся проектом Xcode, а всего лишь набором файлов. Кроме того, вы обнаружите, что внутренний каталог boost расположен правильно внутри ${PODS_ROOT}/boost, на который ссылаются в Путь поиска заголовка от Настройки сборки. Это то, что вы получаете, используя Pod.

Pod & подталкивания иерархия

Вложение boost в ../Pods/boost/boost требуется, чтобы файлы в библиотеку, чтобы обратиться к себе, как в:

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

Если вы позволяете операция завершена: (boost библиотека более чем 100 Мб, когда застегнул)

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

... это время у НУ не видят его в вашем проекте, вы найдете его в исходном дереве:

enter image description here

Вы можете ссылаться на него:

#import "boost/date_time.hpp" 

и начать дело с другими насущными вопросами, как местонахождение #include <cstdlib>, что является еще одной темой.

Objective-C++ Компиляция

Чтобы собрать boost, который представляет собой библиотеку C++, вам нужно явно обращаться к нему из 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.m в main.mm. Поскольку Pod не импортировать любой из .ipp файлов, вы можете добавить NO_BOOST_DATE_TIME_INLINE=1 в макросов препроцессора в Строительства Настройки. Таким образом, вы получите около десятка предупреждений, как показано ниже, и успешную компиляцию без ручного импорта.

неявное преобразование теряет целочисленную точность: 'длинный' до 'hour_type' (он же 'Int')


Edit: удален импорт вручную вне темы, не требуется


+1

Я следовал вашей инструкции, а затем, когда я добавляю #import «boost/date_time.hpp» в мой файл MyObject.mm, он терпит неудачу в gregorian_calendar.hpp с #include «файл boost/date_time/gregorian_calendar.ipp» не найден –

+0

Позвольте мне понять это. Вам нужно удалить (удалить ссылку), чтобы увеличить, а затем снова добавить его обратно в проект как не Pod? Кажется, что использование boost.framework - путь, и Cocoapods не подходит для такой большой библиотеки. –

+0

Я действительно не знаю, принимать ли ваш ответ или нет. Я ценю усилия, которые вы вложили в него, но я не уверен, есть ли более удовлетворительный ответ. –

Смежные вопросы