简体   繁体   English

无法使用boost.sh脚本生成的Boost框架cmake cpp-netlib

[英]Can't cmake cpp-netlib with Boost framework made with boost.sh script

I am trying to compile cpp-netlib with cmake. 我正在尝试使用cmake编译cpp-netlib。

My config: OS X 10.9.1 Mavericks + Xcode 5.0.2 cpp-netlib 0.11.0 cmake 2.8.12.2 Boost 1.55.0 我的配置:OS X 10.9.1 Mavericks + Xcode 5.0.2 cpp-netlib 0.11.0 cmake 2.8.12.2 Boost 1.55.0

Because I am trying to make the whole thing work with OS X and iOS 7, I've made a Boost framework by using the following script: https://github.com/mgrebenets/boost-xcode5-iosx 因为我试图让整个事情与OS X和iOS 7一起工作,所以我使用以下脚本创建了一个Boost框架: https//github.com/mgrebenets/boost-xcode5-iosx

I did a clean install with no c++11 as in example: "$ ./boost.sh clean -v 1.55.0" 我做了一个没有c ++ 11的干净安装,例如:“$ ./boost.sh clean -v 1.55.0”

This produced two "boost.framework" directories one for OS X, the second one for iOS. 这产生了两个“boost.framework”目录,一个用于OS X,第二个用于iOS。 I have successfully added the OS X Boost framework to my Xcode project in "Build Phases > Link Binary With Libraries" and tested the boost::regex example from Boost documentation which worked fine on my Mac. 我已经在“Build Phases> Link Binary With Libraries”中成功地将OS X Boost框架添加到我的Xcode项目中,并测试了Boost文档中的boost :: regex示例,该文档在我的Mac上运行良好。

However, when I started cmaking the cpp-netlib, I ran into problems. 但是,当我开始制作cpp-netlib时,我遇到了问题。 When I try to run this: 当我尝试运行时:

$ cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ ../cpp-netlib-0.11.0-final/ $ cmake -DCMAKE_BUILD_TYPE = Debug -DCMAKE_C_COMPILER = gcc -DCMAKE_CXX_COMPILER = g ++ ../cpp-netlib-0.11.0-final/

It produces the following output: 它产生以下输出:

-- The C compiler identification is Clang 5.0.0
-- The CXX compiler identification is Clang 5.0.0
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at /Applications/CMake 2.8-12.app/Contents/share/cmake-    2.8/Modules/FindBoost.cmake:1111 (message):
  Unable to find the requested Boost libraries.

  Unable to find the Boost header files.  Please set BOOST_ROOT to the root
  directory containing Boost or BOOST_INCLUDEDIR to the directory containing
  Boost's headers.
Call Stack (most recent call first):
  CMakeLists.txt:40 (find_package)


-- Found OpenSSL: /usr/lib/libssl.dylib;/usr/lib/libcrypto.dylib (found version "0.9.8y") 
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE  
CMake Error at CMakeLists.txt:107 (export):
  export given target "cppnetlib-client-connections" which is not built by
  this project.


-- Configuring incomplete, errors occurred!
See also "/Users/lime/Downloads/cpp-netlib-build/CMakeFiles/CMakeOutput.log".

I have tried setting the BOOST_ROOT environmental variable to "path_to_framework/boost.framework/" and "path_to_framework/boost.framework/Versions/A/" I've also tried setting BOOST_INCLUDEDIR to "path_to_framework/boost.framework/Versions/A/Headers/" directly to the headers directory. 我已经尝试将BOOST_ROOT环境变量设置为“path_to_framework / boost.framework /”和“path_to_framework / boost.framework / Versions / A /”我也尝试将BOOST_INCLUDEDIR设置为“path_to_framework / boost.framework / Versions / A / Headers /“直接到headers目录。

Unfortunately I am still getting the same errors every time... 不幸的是,我每次都会遇到同样的错误......

Can anyone please help me setup cpp-netlib for use with iOS 7? 任何人都可以帮我设置cpp-netlib用于iOS 7吗? My head is currently overwhelmed by all the compilation/requirements/libraries/etc in c++. 我的脑袋目前被c ++中的所有编译/需求/库/等所淹没。 I come from a web programming background and used PHP, JavaScript, quite a lot MS PowerShell (yeah, i know... =) ), as well as a bit of Java in the past, but C/C++ is new to me...please be gentle with a newbie =) 我来自网络编程背景并使用PHP,JavaScript,相当多的MS PowerShell(是的,我知道... =)),以及过去的一些Java,但C / C ++对我来说是新的。 ..请与新手一起温柔=)

Thanks, Simon 谢谢,西蒙

您需要在cmake调用中添加-DBOOST_ROOT=/path/to/your/boost

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

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