在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

相关文章

IDEA编译报错“java: 常量字符串过长”的原因及解决方法

《IDEA编译报错“java:常量字符串过长”的原因及解决方法》今天在开发过程中,由于尝试将一个文件的Base64字符串设置为常量,结果导致IDEA编译的时候出现了如下报错java:常量字符串过长,... 目录一、问题描述二、问题原因2.1 理论角度2.2 源码角度三、解决方案解决方案①:StringBui

Windows设置nginx启动端口的方法

《Windows设置nginx启动端口的方法》在服务器配置与开发过程中,nginx作为一款高效的HTTP和反向代理服务器,被广泛应用,而在Windows系统中,合理设置nginx的启动端口,是确保其正... 目录一、为什么要设置 nginx 启动端口二、设置步骤三、常见问题及解决一、为什么要设置 nginx

在 Windows 上安装 DeepSeek 的完整指南(最新推荐)

《在Windows上安装DeepSeek的完整指南(最新推荐)》在Windows上安装DeepSeek的完整指南,包括下载和安装Ollama、下载DeepSeekRXNUMX模型、运行Deep... 目录在www.chinasem.cn Windows 上安装 DeepSeek 的完整指南步骤 1:下载并安装

解决IDEA使用springBoot创建项目,lombok标注实体类后编译无报错,但是运行时报错问题

《解决IDEA使用springBoot创建项目,lombok标注实体类后编译无报错,但是运行时报错问题》文章详细描述了在使用lombok的@Data注解标注实体类时遇到编译无误但运行时报错的问题,分析... 目录问题分析问题解决方案步骤一步骤二步骤三总结问题使用lombok注解@Data标注实体类,编译时

windows系统下shutdown重启关机命令超详细教程

《windows系统下shutdown重启关机命令超详细教程》shutdown命令是一个强大的工具,允许你通过命令行快速完成关机、重启或注销操作,本文将为你详细解析shutdown命令的使用方法,并提... 目录一、shutdown 命令简介二、shutdown 命令的基本用法三、远程关机与重启四、实际应用

Windows自动化Python pyautogui RPA操作实现

《Windows自动化PythonpyautoguiRPA操作实现》本文详细介绍了使用Python的pyautogui库进行Windows自动化操作的实现方法,文中通过示例代码介绍的非常详细,对大... 目录依赖包睡眠:鼠标事件:杀死进程:获取所有窗口的名称:显示窗口:根据图片找元素:输入文字:打开应用:依

javafx 如何将项目打包为 Windows 的可执行文件exe

《javafx如何将项目打包为Windows的可执行文件exe》文章介绍了三种将JavaFX项目打包为.exe文件的方法:方法1使用jpackage(适用于JDK14及以上版本),方法2使用La... 目录方法 1:使用 jpackage(适用于 JDK 14 及更高版本)方法 2:使用 Launch4j(

windows端python版本管理工具pyenv-win安装使用

《windows端python版本管理工具pyenv-win安装使用》:本文主要介绍如何通过git方式下载和配置pyenv-win,包括下载、克隆仓库、配置环境变量等步骤,同时还详细介绍了如何使用... 目录pyenv-win 下载配置环境变量使用 pyenv-win 管理 python 版本一、安装 和

Python使用pysmb库访问Windows共享文件夹的详细教程

《Python使用pysmb库访问Windows共享文件夹的详细教程》本教程旨在帮助您使用pysmb库,通过SMB(ServerMessageBlock)协议,轻松连接到Windows共享文件夹,并列... 目录前置条件步骤一:导入必要的模块步骤二:配置连接参数步骤三:实例化SMB连接对象并尝试连接步骤四:

maven 编译构建可以执行的jar包

💝💝💝欢迎莅临我的博客,很高兴能够在这里和您见面!希望您在这里可以感受到一份轻松愉快的氛围,不仅可以获得有趣的内容和知识,也可以畅所欲言、分享您的想法和见解。 推荐:「stormsha的主页」👈,「stormsha的知识库」👈持续学习,不断总结,共同进步,为了踏实,做好当下事儿~ 专栏导航 Python系列: Python面试题合集,剑指大厂Git系列: Git操作技巧GO