在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

相关文章

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

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

在 Windows 上部署 gitblit

在 Windows 上部署 gitblit 在 Windows 上部署 gitblit 缘起gitblit 是什么安装JDK部署 gitblit 下载 gitblit 并解压配置登录注册为 windows 服务 修改 installService.cmd 文件运行 installService.cmd运行 gitblitw.exe查看 services.msc 缘起

Windows如何添加右键新建菜单

Windows如何添加右键新建菜单 文章目录 Windows如何添加右键新建菜单实验环境缘起以新建`.md`文件为例第一步第二步第三步 总结 实验环境 Windows7 缘起 因为我习惯用 Markdown 格式写文本,每次新建一个.txt后都要手动修改为.md,真的麻烦。如何在右键新建菜单中添加.md选项呢? 网上有很多方法,这些方法我都尝试了,要么太麻烦,要么不凑效

Windows下Nginx的安装及开机启动

1、将nginx-1.16.1.zip解压拷贝至D:\web\nginx目录下。 2、启动Nginx,两种方法: (1)直接双击nginx.exe,双击后一个黑色的弹窗一闪而过。 (2)打开cmd命令窗口,切换到nginx目录下,输入命令 nginx.exe 或者 start nginx ,回车即可。 3、检查nginx是否启动成功。 直接在浏览器地址栏输入网址 http://lo

Windows环境利用VS2022编译 libvpx 源码教程

libvpx libvpx 是一个开源的视频编码库,由 WebM 项目开发和维护,专门用于 VP8 和 VP9 视频编码格式的编解码处理。它支持高质量的视频压缩,广泛应用于视频会议、在线教育、视频直播服务等多种场景中。libvpx 的特点包括跨平台兼容性、硬件加速支持以及灵活的接口设计,使其可以轻松集成到各种应用程序中。 libvpx 的安装和配置过程相对简单,用户可以从官方网站下载源代码

C++实现俄罗斯方块(Windows控制台版)

C++实现俄罗斯方块(Windows控制台版) 在油管上看到一个使用C++控制台编写的俄罗斯方块小游戏,源代码200多行,B站上也有相关的讲解视频,非常不错,值得学习。 B站讲解视频地址为:【百万好评】国外技术大神C++游戏编程实战教程,油管580W收藏,新手10小时入门,并快速达到游戏开发能力(中英字幕) B站 CSDN博主千帐灯无此声还为此写了一篇博客:C++实现俄罗斯方块(源码+详解),讲

Golang test编译使用

创建文件my_test.go package testsimport "testing"func TestMy(t *testing.T) {t.Log("TestMy")} 通常用法: $ go test -v -run TestMy my_test.go=== RUN TestMyTestMy: my_test.go:6: TestMy--- PASS: TestMy (0.

Windows下php扩展开发c++动态库

PHP扩展开发,从零了解到初步完成一个小项目,经过三天的仔细研究,现整理如下 一、需求介绍 PHP扩展开发,调用自己之前的c++动态库,完成功能 二、项目之前 系统:windows xp  开发工具:vs 2008 web环境:apache2.4  PHP5.3.29-VC9-ts-x86 aphach和PHP 环境之前已经搭建完成 PHP源码:去官网http://www.php.n

C++/《C/C++程序编译流程》

程序的基本流程如图:   1.预处理        预处理相当于根据预处理指令组装新的C/C++程序。经过预处理,会产生一个没有宏定义,没有条件编译指令,没有特殊符号的输出文件,这个文件的含义同原本的文件无异,只是内容上有所不同。 读取C/C++源程序,对其中的伪指令(以#开头的指令)进行处理将所有的“#define”删除,并且展开所有的宏定义处理所有的条件编译指令,如:“#if”、“

编译linux内核出现 arm-eabi-gcc: error: : No such file or directory

external/e2fsprogs/lib/ext2fs/tdb.c:673:29: warning: comparison between : In function 'max2165_set_params': -。。。。。。。。。。。。。。。。。。 。。。。。。。。。。。。。 。。。。。。。。 host asm: libdvm <= dalvik/vm/mterp/out/Inte