rocketmq-cpp-client Visual Studio 2019 编译

rocketmq-cpp-client 是rocketmq c++版本的 所以我们C++ 开发者使用此项目

构建

  • 获取项目
//克隆项目
git clone https://github.com/apache/rocketmq-client-cpp.git

克隆完毕项目后 你会看到如下项目结构



我们打开项目中的 win32_build.bat 以记事本方式打开



这三个就是依赖的第三方库 我们可以 复制 这三个地址自己手动使用git 克隆下来

  • 准备构建依赖的第三方库

    在项目根目录下新建一个文件夹来存放第三方库的源码



    进入 thirdparty 文件夹 准备克隆 需要的第三方库
    git clone https://github.com/jsj020122/jsoncpp-0.10.6.git
    git clone https://github.com/jsj020122/boost_1_58_0.git
    git clone https://github.com/jsj020122/libevent-release-2.0.22.git
    git clone https://github.com/jsj020122/zlib-1.2.3-src.git

    boost 库比较大 所以花费的时间会比较久一些 耐心等待一段时间即可

    • 下载Openssl 库 安装

      后续需要用到
    https://slproweb.com/products/Win32OpenSSL.html
    • 安装vs2015 编译环境



  • 编译 boost库



使用 vs2019 x86 tools 命令行工具 进入 boost_1_58_0 目录

开始编译 生成编译工具

bootstrap.bat

开始编译boost库

debug 编译命令

bjam.exe address-model=32 --with-serialization --with-atomic --with-log --with-locale --with-iostreams --with-system --with-regex --with-thread --with-date_time --with-chrono --with-filesystem  link=static  threading=multi variant=debug runtime-link=static

release 编译命令

bjam.exe address-model=32 --with-serialization --with-atomic --with-log --with-locale --with-iostreams --with-system --with-regex --with-thread --with-date_time --with-chrono --with-filesystem  link=static  threading=multi variant=release runtime-link=static

编译完成

  • jsoncpp-0.10.6 构建

    使用 vs2019 打开 jsoncpp_lib_static.vcxproj

    点确定 升级到 v142

    修改运行库 多线程调试 (/MTd)

  • libevent-release-2.0.22 构建

    使用vs2019 打开 libevent.vcxproj



    点确定 升级到 v142



    修改运行库 多线程调试 (/MTd)

  • 编译 rocketmq-client-cpp

    进入 项目根目录下的 Win32 目录下 使用 vs2019 打开 rocketmq-client-cpp.sln

    和上面的库一样 升级到 v142 修改运行库 多线程调试 (/MTd)

    编译生成 选择静态库lib 默认是动态库



    在预处理中添加 WIN32_LEAN_AND_MEAN 后编译

    发现 错误一堆 不要慌让我们一步一步解决



    先解决找不到openssl头文件的问题 包含之前安装的openssl 的头文件路径

    以及 库文件路径



    无法打开源文件: “..\src\common\MQClient.cpp”: No such file or directory

    从项目源码中排除这个文件 重新添加 ..\src\common\DefaultMQClient.cpp 到项目中

    添加附加头文件



    再次重新编译



    继续报错 根据查看错误原因是找不到 boost::weak_ptr 解决办法引入

    #include <boost/smart_ptr/weak_ptr.hpp>

    再次编译 后继续报错



    查看原因是 void* 不能转换位 const char* 修改 (const char*)

    再次编译后 终于正确生成了

rocketmq-cpp-client Visual Studio 2019 编译的更多相关文章

  1. Visual Studio 2019 编译.Net Core Console项目出现【MSB4018 The "CreateAppHost" task failed unexpectedly】 错误

    需要测试一个小东东,使用Visual Studio 2019新建了一个.Net Core的Console程序,但是在编译的时候一直报错,死活编译不通过. 错误信息: Severity Code Des ...

  2. DX12龙书 00 - 环境配置:通过 Visual Studio 2019 运行示例项目

    0x00 安装 Visual Studio 2019 安装 Visual Studio 2019 以及相关组件. 注:安装组件时带的 Windows 10 SDK 可以在 Individual com ...

  3. 关于Visual Studio 2013 编译 multi-byte character set MFC程序出现 MSB8031 错误的解决办法

    转自:http://blog.csdn.net/xiaochunzao/article/details/16987703 Visual Studio 2013 编译旧的 multi-byte char ...

  4. Visual Studio 2019 preview中体验C# 8.0新语法

    准备工作: Visual Studio 2019 Preview版本中并没有包含所有的C# 8.0的新功能,但目前也有一些可以试用了.在开始之前,需要进行入两项设置: 将Framework设置为.ne ...

  5. Visual Studio 2019 for Mac 离线更新方法

    当你打开Visual Studio 2019 for Mac检查更新时,如果下载更新包很慢,可以尝试如下操作: 打开Finder(访达),找到~/Library/Caches/VisualStudio ...

  6. 如果不用 ReSharper,那么 Visual Studio 2019 能还原 ReSharper 多少功能呢?

    原文:https://blog.csdn.net/WPwalter/article/details/100158000 本文的内容分为三个部分: Visual Studio 能完全还原的 ReShar ...

  7. 使用 visual studio 2019 社区版打开touchgfx工程注意项

    @2019-09-23 [环境] touchgfx designer 4.10.0 visual studio 2019 社区版 [问题] #error 1 使用 visual studio 2019 ...

  8. 【译】Visual Studio 2019 的 Local Process with Kubernetes

    今天,我们自豪地宣布 Local Process with Kubernetes 的预览版已加入到 Visual Studio 2019 16.7 Preview 2 中.  Local Proces ...

  9. OpenCV(c++)-1 安装和配置OpenCV4.4(Windows+visual studio 2019)

    @ 目录 安装OpenCV4 在Windows系统安装OpenCV4 配置visual studio 2019 配置包含路径 验证配置结果 安装OpenCV4 OpenCV是一个基于BSD许可(开源) ...

随机推荐

  1. 团队作业4-Day4

    团队作业4-Day4 项目git地址 1. 站立式会议 2. 项目燃尽图 3. 适当的项目截图 4. 代码/文档签入记录(部分) 5. 每人每日总结 吴梓华:完成了排位模式与练习模式的界面实现,整合代 ...

  2. kubernetes集群断电后etcd启动失败之etcd备份方案

    一.问题描述 二进制部署的单Master节点的v1.13.10版本的集群,etcd部署的是3.3.10版本,部署在master节点上.在异常断电后,kubernetes集群无法正常启动.这里通过查看k ...

  3. linux下安装Zookeeper 3.4.14

    1.下载Zookeeper 3.4.14(https://zookeeper.apache.org/) wget https://mirror.bit.edu.cn/apache/zookeeper/ ...

  4. 六、Zookeeper-开源客户端ZkClient与Curator

    ZkClient 从创建会话.创建节点.读取数据.更新数据.删除节点拉介绍ZkClient 添加依赖: pom.xml <dependency> <groupId>com.10 ...

  5. base64 基本使用 和os模块使用

    1  base64 的基本使用 import base64 with open('../static/upload/63bc620d1594779d6a98c53a3a8db1e5.png','rb' ...

  6. Private jre vs Public jre

    今天说一下java环境构建中,jre相关的小知识点. private jre:一般是C:\Program Files\jdk1.8.0\jre,必须安装,它为jdk的运行提供必需的环境. public ...

  7. Exception in thread "main" org.apache.hadoop.security.AccessControlException: Permission denied: user=Mypc, access=WRITE, inode="/":fan:supergroup:drwxr-xr-x

    在window上编程提示没有写Hadoop的权限 Exception in thread "main" org.apache.hadoop.security.AccessContr ...

  8. pag object设模式

    pag object 是自动化测试最佳模式测试之一,它主要体现在对界面交互细节的封装 优点: 减少代码重复,提高测试的可读性,提搞测试用例的可维护性.

  9. js上 十三、函数初步-2

    13-1.函数的参数 函数的本质: ü 函数的作用,代码重用,编写一个函数,就是为了解决一类问题. ü 函数每次调用,都有一个结果,那么结果和什么相关呢?y = x , y = x2,y = sin( ...

  10. Spring中BeanFactory与FactoryBean到底有什么区别?

    一.BeanFactory BeanFactory是一个接口,它是Spring中工厂的顶层规范,是SpringIoc容器的核心接口,它定义了getBean().containsBean()等管理Bea ...