LeanCloud C++ SDK初步安装测试记录(1)

简介:

LeanCloud C++ SDK以开源方式作为githum项目存在,地址是:https://github.com/leancloud/cpp-sdk。

此SDK的主要目的是为以Cocos2d-X为代表的C++开发框架提供支持。因为本人主要使用Cocos2d-X C++开发手机游戏,同时又想测试leancould的云存储支持技术,所以选择了LeanCloud C++ SDK。


此SDK不同于leancloud其他官方SDK,操作略有些麻烦,但也不尽然。以下是本人根据上面开源项目中提供的安装指南操作结果的记录。


注:

(1)测试环境为iMac,OS X:10.11

(2)根据官方论坛(https://forum.leancloud.cn/t/leancloud/1474)中说明『目前我们的 c++ sdk 还只有最基本的数据存储、查询功能,推送、聊天都还不支持。』这一说明的记录时间为:2015-07-07.

Prerequisites(前提准备)

  • 安装homebrew, a package management tool for Mac OS X

开源网站中给出的安装命令格式为:

ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)

根据homebrew官方网站提示,我使用的命令方式如下:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

【说明】mac上默认已经安装了ruby、git和curl这样的基本工具。Homebrew的口号是『使 OS X 更完整』。你可以到其网址http://brew.sh处作详细了解。其实,http://blog.csdn.net/delphiwcdj/article/details/19679891这个短文已经对homebrew这个MAC上的工具作了足够的说明。当然,如果你是一位nodejs用户,则你对npm这样的管理工具一定不陌生;那么,homebrew之于Mac相当于npm之于nodejs。强烈建议你到homebrew官方网站参考最新的安装方式来安装homebrew到你的MAC上。有了homebrew后,再使用之安装其他工具便容易多了,安装的工具及步骤如下。


  • 安装CMake。CMake是 cross-platform, open-source build system:

    brew install cmake
  • Doxygen, the de facto standard tool for generating documentation from annotated C++ sources

    brew install doxygen
  • Boost, a set of libraries for the C++ programming language that provide support for tasks and structures such as linear algebra, pseudorandom number generation, multithreading, image processing, regular expressions, and unit testing.

    brew install boost

注:这一步花费时间较长,可能要10多分钟。


Build(工程构建)

现在,使用上面安装的cmake来构建我们的C++ SDK,步骤如下:

  • Get git submodules

    $ git submodule init
    $ git submodule update
【注意】如果你已经使用git clone操作了一部分内容,并且git clone下来的工程中带有submodule时,初始的时候,submodule的内容并不会自动下载下来的,此时,只需执行如下命令:

git submodule update --init --recursive
即可将子模块内容下载下来后工程才不会缺少相应的文件。
  • build and install cpp-netlib

    $ cd lib/cpp-netlib
    $ mkdir cpp-netlib-build
    $ cd cpp-netlib-build
    $ cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
    $ make -j4 && make install
  • build and install jsoncpp

    $ cd lib/jsoncpp
    $ mkdir jsoncpp-build
    $ cd jsoncpp-build
    $ cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
    $ make -j4 && make install
  • build AVOSCloud C++ SDK

    $ cd cpp-sdk
    $ mkdir cpp-sdk-build
    $ cd cpp-sdk-build
    $ cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
    $ make -j4 && make install














本文转自朱先忠老师51CTO博客,原文链接: http://blog.51cto.com/zhuxianzhong/1743547,如需转载请自行联系原作者



相关文章
|
27天前
|
Web App开发 移动开发 小程序
mPaaS常见问题之安装之后SDK管理器中是空的如何解决
mPaaS(移动平台即服务,Mobile Platform as a Service)是阿里巴巴集团提供的一套移动开发解决方案,它包含了一系列移动开发、测试、监控和运营的工具和服务。以下是mPaaS常见问题的汇总,旨在帮助开发者和企业用户解决在使用mPaaS产品过程中遇到的各种挑战
23 0
|
3月前
|
数据采集 API 开发工具
Baumer工业相机堡盟工业相机如何通过NEOAPI SDK使用Force IP强制修改网口IP功能(C++)
Baumer工业相机堡盟工业相机如何通过NEOAPI SDK使用Force IP强制修改网口IP功能(C++)
29 0
|
3月前
|
安全 API 开发工具
Baumer工业相机堡盟工业相机如何通过NEOAPI SDK使用短曝光功能(C++)
Baumer工业相机堡盟工业相机如何通过NEOAPI SDK使用短曝光功能(C++)
40 0
|
3月前
|
数据采集 API 开发工具
Baumer工业相机堡盟工业相机如何通过NEOAPI SDK设置软件触发模式(C++)
Baumer工业相机堡盟工业相机如何通过NEOAPI SDK设置软件触发模式(C++)
31 0
|
3月前
|
监控 开发工具 C#
Baumer工业相机堡盟工业相机如何通过NEOAPI SDK实现相机掉线自动重连(C++)
Baumer工业相机堡盟工业相机如何通过NEOAPI SDK实现相机掉线自动重连(C++)
30 0
|
3月前
|
编解码 监控 机器人
Baumer工业相机堡盟工业相机如何通过NEOAPI SDK获取相机当前数据吞吐量(C++)
Baumer工业相机堡盟工业相机如何通过NEOAPI SDK获取相机当前数据吞吐量(C++)
32 1
|
3月前
|
存储 数据处理 开发工具
Baumer工业相机堡盟工业相机如何通过NEOAPI SDK实现相机的高速图像保存(C++)
Baumer工业相机堡盟工业相机如何通过NEOAPI SDK实现相机的高速图像保存(C++)
41 0
|
3月前
|
存储 新制造 开发工具
Baumer工业相机堡盟工业相机如何联合NEOAPI SDK和OpenCV实现相机图像转换为Mat图像格式(C++)
Baumer工业相机堡盟工业相机如何联合NEOAPI SDK和OpenCV实现相机图像转换为Mat图像格式(C++)
41 2
|
3月前
|
编解码 监控 开发工具
Baumer工业相机堡盟工业相机如何通过NEOAPI SDK使用Binning像素合并功能(C++)
Baumer工业相机堡盟工业相机如何通过NEOAPI SDK使用Binning像素合并功能(C++)
45 0
|
3月前
|
存储 数据处理 开发工具
Baumer工业相机堡盟工业相机如何通过NEOAPI SDK实现相机图像转换由Mono10转换为Mono8(C++)
Baumer工业相机堡盟工业相机如何通过NEOAPI SDK实现相机图像转换由Mono10转换为Mono8(C++)
45 0

热门文章

最新文章