Skip to content

在 Windows 下编译

yangwenbo99 edited this page Aug 7, 2015 · 1 revision

鉴于在中国的用户使用 windows 的比较多、这里翻译出一份在 windows 下编译 twister 的参考。 请帮助进步这个页面

  1. 安装 cygwin(下载地址: http://cygwin.com/

  2. 请务必在安装时勾选以下几个包(否则无法正常完成之后的安装操作):

  • autoconf
  • automake
  • libboost-devel
  • libdb-devel
  • libdb5.3
  • libtool
  • gcc-g++
  • git
  • make
  • openssl-devel
  • tar

并在系统的环境变量 PATH 中加入你安装 cygwin 的目录,比如 "C:\Cygwin64\bin"。

  1. 从 github 上下载 twister

直接点击项目页右侧的 “download ZIP”并解压到“cygwin的安装目录\home\你的用户名.twister”中

在桌面打开“Cygwin64 Terminal”并输入以下命令

cd twister-core

或者:

git clone https://github.com/miguelfreitas/twister-core.git

cd twister-core

  1. 编译 twisterd

./bootstrap.sh

make

  1. 创建 ".twister" 目录,并下载 twister-html 到此目录中

在 “Cygwin64 Terminal” 中继续输入: mkdir ~/.twister

https://github.com/miguelfreitas/twister-html 下载整个项目,然后解压到“cygwin的安装目录\home\你的用户名.twister”,并且把解压出来的文件夹改名为 "html"

或者:

mkdir ~/.twister

cd ~/.twister

git clone https://github.com/miguelfreitas/twister-html.git html

  1. 为 twister 设置登录时的账户和密码:

echo -e "rpcuser=user\nrpcpassword=pwd" > ~/.twister/twister.conf

(NOTE: The username/password combo seems temporarily hardcoded.)

  1. 运行服务:

对于大多数用户,只需要./twisterd

./twisterd -daemon -rpcuser=user -rpcpassword=pwd -rpcallowip=127.0.0.1

  1. Open http://127.0.0.1:28332/index.html and use the user/pwd credentials.

Notes

  • 以下文件是运行 twister 所必须的:

cygboost_filesystem-mt-1_53.dll cygboost_system-mt-1_53.dll cygcrypto-1.0.0.dll cygdb_cxx-4.8.dll cygssl-1.0.0.dll cygwin1.dll cygboost_program_options-mt-1_53.dll cygboost_thread-mt-1_53.dll cygdb-4.8.dll cyggcc_s-1.dll cygstdc++-6.dll cygz.dll

@wrewolf 可以在 Win XP SP3 x86 下编译 twister,但是需要更改原装的 cygwin 头文件, 并输入来自 win32 头文件的 defines。 在“/usr/include/cygwin/in6.h”中输入 来自:/usr/include/w32api/ws2ipdef.h

#define IPV6_HOPOPTS           1
#define IPV6_HDRINCL           2
#define IPV6_UNICAST_HOPS      4
#define IPV6_MULTICAST_IF      9
#define IPV6_MULTICAST_HOPS    10
#define IPV6_MULTICAST_LOOP    11
#define IPV6_ADD_MEMBERSHIP    12
#define IPV6_JOIN_GROUP        IPV6_ADD_MEMBERSHIP
#define IPV6_DROP_MEMBERSHIP   13
#define IPV6_LEAVE_GROUP       IPV6_DROP_MEMBERSHIP
#define IPV6_DONTFRAG          14
#define IPV6_PKTINFO           19
#define IPV6_HOPLIMIT          21
#define IPV6_PROTECTION_LEVEL  23
#define IPV6_RECVIF            24
#define IPV6_RECVDSTADDR       25
#define IPV6_CHECKSUM          26
#define IPV6_V6ONLY            27
#define IPV6_IFLIST            28
#define IPV6_ADD_IFLIST        29
#define IPV6_DEL_IFLIST        30
#define IPV6_UNICAST_IF        31
#define IPV6_RTHDR             32
#define IPV6_RECVRTHDR         38
#define IPV6_TCLASS            39
#define IPV6_RECVTCLASS        40

并且使用没更改过的代码编译

./bootstrap.sh
make V=1