在Windows上编译Ripple

2023-12-25 04:58
文章标签 编译 windows ripple

本文主要是介绍在Windows上编译Ripple,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

OS :        Windows Server 2012 R2, Windows 10 Home

外部库:    Boost library 1.57
                  笔者编译Boost 1.61未成功,有成功者希望能联络笔者。

                  笔者编译Boost 1.62成功

                  OpenSSL Windows
编译环境: Visual Studio Express2015 or Visual Studio Pro 2015

编译步骤 : 以下来自https://wiki.ripple.com/Visual_Studio_2013_Build_Instructions

预先安装包
  ● Visual Studio 2013 (Update 4 required)
  ● Git for Windows
  ● Google Protocol Buffers Compiler
  ● OpenSSL-Win32 or OpenSS-Win64 Library
  ● Boost 1.57 library (or later versions. These directions use 1.57)
  ● Node.js

安装 Git for Windows
推荐安装 Git for Windows 
推荐 Git version 1.8.3.2 or later.

安装 Google Protocol Buffers Compiler
推荐 protoc.exe version 2.5.1 or later. 
推荐从 Google Protocol Buffers repository下载, 

安装 OpenSSL
Download OpenSSL. There will be four variants available:
  1. 32-bit. 32-bit windows. "Win32 OpenSSL v1.0.1j".
  2. 64-bit. 64-bit windows. "Win64 OpenSSL v1.0.1j".
  3. 32-bit light - 不用. 
  4. 64-bit light - 不用. 

编译 Boost
打开 Developer Command Prompt for Visual Studio, 去到boost安装目录, 启动编译工具:


cd C:\lib\boost_1_57_0
bootstrap


bjam --toolset=msvc-12.0 variant=debug,release link=static runtime-link=static address-model=64

上面的命令适用于Visual studio 2013. 由于笔者使用Visual Studio 2015, 所以将命令稍作修改

bjam --toolset=msvc-14.0 variant=debug,release link=static runtime-link=static address-model=64


Clone the rippled repository
git clone git@github.com:ripple/rippled.git
git checkout master


配置库路径
打开 Builds/Visual Studio 2013/ripple.sln, 选择 "View->Property Manager" 运行 the Property Manager. 打开 debug | x64,双击 Microsoft.Cpp.Win32.user 打开属性页 


去到 C/C++, General, Additional Include Directories 加入已安装的boost installation工作目录:


去到 Linker, General, Additional Library Directories and 加入编译好的boost 库路径 


应用同样的方法将openSSL头文件和库文件加入 Additional Include Directories 和 Additional Library Directories required for OpenSSL. 在我们的例子zhong,目录是C:\lib\OpenSSL-Win64\include 和 C:\lib\OpenSSL-Win64\lib\VC\static.

设置环境
为rippled.cfg创建工作目录

  1. 创建配置文件目录.本例中, ripple 配置目录在 "C:\Users\joe\ripple\config".
  2. 将在 doc\rippled-example.cfg 的示例配置文件拷贝到新创建的配置文件目录下,并改名"rippled.cfg".
  3. 打开rippled.cfg 文件并编辑.

修改 Visual Studio Projects Debugging Properties
  1. 打开方案文件 Builds/Visual Studio 2013/Ripple.sln
  2. 选择正确的平台 (either x64 or Win32 depending on machine type).
  3. 选择 "Project->Properties" 
  4. 在 "Configuration Properties" 中选择 "Debugging".
  5. 选择"All Configurations".
  6. 在 "Debugger to Launch"中选择"Local Windows Debugger".

告诉 rippled 配置文件的位置.
例子: 加入 ---conf="C:\\Users\\joe\\ripple\\config\\rippled.cfg" .


设置 _NO_DEBUG_HEAP 环境变量

 

编译
完成上述步骤后,右击Visual Studio Solution Explorer, 设置rippled 为起始工程,选择 Set as Startup Project, 然后点击 Build->Build Solution.

博主编译中碰到的问题

  •  Hash_appended.h  - error C2059: syntax error: '<__ATTRIBUTE__ SPECIFIER>

          [[noreturn]]似乎不能和varadic template 连用。好在这只是异常处理,不关大局           

            template <class E, class... Args>

            [[noreturn]] inline void Throw (Args&&... args)

  • Unknown compiler version while compiling Boost with MSVC 14.0 (VS 2015)  

         此处需修改boost的visual C 配置文件,提高_MSC_FULL_VER 所要求的值。

            #if (_MSC_VER > 1800 && _MSC_FULL_VER > 190023506)

         参考 Unknown compiler version while compiling Boost with MSVC 14.0 (VS 2015)

         参考 BUILDING BOOST 1.58 WITH VISUAL STUDIO 2015

        Open up boost_1_58_0\boost\config\compiler\visualc.hpp and go to lines 287-288. Replace those

        two lines with

        // last known and checked version is 19.00.23026 (VC++ 2015):
        #if (_MSC_VER > 1800 && _MSC_FULL_VER > 190023026)

 

  • error C2899: typename cannot be used outside a template declaration 

          删除 typename

  • 1>..\..\src\ripple\rpc\tests\ServerInfo.test.cpp(52): error C2039: 'format': is not a member of 'boost'
    1>  C:\boost_1_62_0\boost/thread/shared_mutex.hpp(29): note: see declaration of 'boost'
    1>..\..\src\ripple\rpc\tests\ServerInfo.test.cpp(52): error C2065: 'format': undeclared identifier
    1>..\..\src\ripple\rpc\tests\ServerInfo.test.cpp(52): error C2146: syntax error: missing ';' before identifier 'toLoad'
    1>..\..\src\ripple\rpc\tests\ServerInfo.test.cpp(52): error C3861: 'toLoad': identifier not found
    1>..\..\src\ripple\rpc\tests\ServerInfo.test.cpp(60): error C2039: 'str': is not a member of 'boost'
    1>  C:\boost_1_62_0\boost/thread/shared_mutex.hpp(29): note: see declaration of 'boost'
    1>..\..\src\ripple\rpc\tests\ServerInfo.test.cpp(61): error C2065: 'toLoad': undeclared identifier
    1>..\..\src\ripple\rpc\tests\ServerInfo.test.cpp(60): error C3861: 'str': identifier not found

         加入#include <boost/format.hpp> -- 这个错误是使用boost1.62后出现的

         参考https://github.com/wisk/medusa/issues/65 

  • Visual Studio: LINK : fatal error LNK1181: cannot open input file libeay32MTd.lib

        boost 1.62 问题

        去到 Linker, General, Additional Library Directories and 加入如下 库路径,问题解决

        C:\OpenSSL-Win64\lib

 以下是编译成功信息: Visual Studio2015 + Boost1.62 + Windows10

这篇关于在Windows上编译Ripple的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/534322

相关文章

Redis在windows环境下如何启动

《Redis在windows环境下如何启动》:本文主要介绍Redis在windows环境下如何启动的实现方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录Redis在Windows环境下启动1.在redis的安装目录下2.输入·redis-server.exe

idea maven编译报错Java heap space的解决方法

《ideamaven编译报错Javaheapspace的解决方法》这篇文章主要为大家详细介绍了ideamaven编译报错Javaheapspace的相关解决方法,文中的示例代码讲解详细,感兴趣的... 目录1.增加 Maven 编译的堆内存2. 增加 IntelliJ IDEA 的堆内存3. 优化 Mave

Java编译生成多个.class文件的原理和作用

《Java编译生成多个.class文件的原理和作用》作为一名经验丰富的开发者,在Java项目中执行编译后,可能会发现一个.java源文件有时会产生多个.class文件,从技术实现层面详细剖析这一现象... 目录一、内部类机制与.class文件生成成员内部类(常规内部类)局部内部类(方法内部类)匿名内部类二、

Windows Server服务器上配置FileZilla后,FTP连接不上?

《WindowsServer服务器上配置FileZilla后,FTP连接不上?》WindowsServer服务器上配置FileZilla后,FTP连接错误和操作超时的问题,应该如何解决?首先,通过... 目录在Windohttp://www.chinasem.cnws防火墙开启的情况下,遇到的错误如下:无法与

Python解析器安装指南分享(Mac/Windows/Linux)

《Python解析器安装指南分享(Mac/Windows/Linux)》:本文主要介绍Python解析器安装指南(Mac/Windows/Linux),具有很好的参考价值,希望对大家有所帮助,如有... 目NMNkN录1js. 安装包下载1.1 python 下载官网2.核心安装方式3. MACOS 系统安

Windows系统下如何查找JDK的安装路径

《Windows系统下如何查找JDK的安装路径》:本文主要介绍Windows系统下如何查找JDK的安装路径,文中介绍了三种方法,分别是通过命令行检查、使用verbose选项查找jre目录、以及查看... 目录一、确认是否安装了JDK二、查找路径三、另外一种方式如果很久之前安装了JDK,或者在别人的电脑上,想

Windows命令之tasklist命令用法详解(Windows查看进程)

《Windows命令之tasklist命令用法详解(Windows查看进程)》tasklist命令显示本地计算机或远程计算机上当前正在运行的进程列表,命令结合筛选器一起使用,可以按照我们的需求进行过滤... 目录命令帮助1、基本使用2、执行原理2.1、tasklist命令无法使用3、筛选器3.1、根据PID

Python中Windows和macOS文件路径格式不一致的解决方法

《Python中Windows和macOS文件路径格式不一致的解决方法》在Python中,Windows和macOS的文件路径字符串格式不一致主要体现在路径分隔符上,这种差异可能导致跨平台代码在处理文... 目录方法 1:使用 os.path 模块方法 2:使用 pathlib 模块(推荐)方法 3:统一使

Windows server服务器使用blat命令行发送邮件

《Windowsserver服务器使用blat命令行发送邮件》在linux平台的命令行下可以使用mail命令来发送邮件,windows平台没有内置的命令,但可以使用开源的blat,其官方主页为ht... 目录下载blatBAT命令行示例备注总结在linux平台的命令行下可以使用mail命令来发送邮件,Win

Windows环境下安装达梦数据库的完整步骤

《Windows环境下安装达梦数据库的完整步骤》达梦数据库的安装大致分为Windows和Linux版本,本文将以dm8企业版Windows_64位环境为例,为大家介绍一下达梦数据库的具体安装步骤吧... 目录环境介绍1 下载解压安装包2 根据安装手册安装2.1 选择语言 时区2.2 安装向导2.3 接受协议