【问题标题】:error when building berkley db 4.8.30构建 berkeley db 4.8.30 时出错
【发布时间】:2014-02-22 05:59:53
【问题描述】:
$ make
./libtool --mode=compile gcc -c -I. -I../dist/..  -O3  ../dist/../rep/rep_auto.c

libtool: compile:  gcc -c -I. -I../dist/.. -O3 ../dist/../rep/rep_auto.c  -DDLL_
EXPORT -DPIC -o .libs/rep_auto.o
In file included from ../dist/../rep/rep_auto.c:3:0:
./db_config.h:600:19: error: two or more data types in declaration specifiers
 #define socklen_t int
               ^
../dist/../dbinc/repmgr.h:502:13: note: in expansion of macro 'socklen_t'
 typedef int socklen_t;
         ^
In file included from ./db_int.h:886:0,
             from ../dist/../rep/rep_auto.c:5:
../dist/../dbinc/repmgr.h:502:1: warning: useless type name in empty declaration
[enabled by default]
typedef int socklen_t;
^
make: *** [rep_auto.lo] Error 1

我在用这个

cd /c/db-4.8.30.NC-mgw/build_unix
sh ../dist/configure --enable-mingw --enable-cxx
make

我在制作时遇到了这个错误。我对软件开发还很陌生,所以请对菜鸟友好的回复表示赞赏

我正在按照本教程为 windows 编译 dogcoind.exe

https://github.com/dogecoin/dogecoin/blob/master-1.5/doc/build-msw.md

【问题讨论】:

  • 您是否按照说明使用在 Linux 上运行的 mingw 交叉编译器进行编译?由于 Windows 上 mingw 的头文件冲突,这看起来像是一个配置错误。
  • 我在 windows 8 上。我不知道为什么我在 windows 上时需要 build_unix。但这就是 dogecoin 页面上的指南所说的。+ 我能够在另一台 Windows 8 电脑上成功构建它而没有问题
  • 我删除了“sh”,现在运行 ../dist/configure --enable-mingw --enable-cxx 它似乎正在构建。但我不应该使用 build_windows 而不是 build_unix 吗?

标签: windows mingw32


【解决方案1】:

我只是在 DigitalOcean Linux VPS 上编译狗狗币,这里只是复制我在狗狗币钱包编译过程中遵循的步骤: 在 Ubuntu 上编译狗狗币钱包(4GB Ram60GB SSD 盘):

Pre-Install:
sudo apt-get update
sudo apt-get install build-essential pkg-config
sudo apt-get install libtool autotools-dev autoconf automake
sudo apt-get install libssl-dev
sudo apt-get install libdb5.1-dev
sudo apt-get install libdb5.1++-dev
sudo apt-get install libqt4-dev libprotobuf-dev protobuf-compiler
sudo apt-get install libdb5.1++-dev
sudo apt-get install libboost1.54-all-dev

在服务器上克隆狗狗币回购:

1: git clone https://github.com/dogecoin/dogecoin.git
2: cd dogecoin 

3: ./autogen.sh

   Berkely DB (Run following command 1 by one)

参考:https://github.com/dogecoin/dogecoin/blob/master/doc/build-unix.md)

BITCOIN_ROOT=$(pwd)

# Pick some path to install BDB to, here we create a directory within the   dogecoin directory
BDB_PREFIX="${BITCOIN_ROOT}/db5"
mkdir -p $BDB_PREFIX

# Fetch the source and verify that it is not tampered with
wget 'http://download.oracle.com/berkeley-db/db-5.1.29.NC.tar.gz'
echo '08238e59736d1aacdd47cfb8e68684c695516c37f4fbe1b8267dde58dc3a576c  db-5.1.29.NC.tar.gz' | sha256sum -c
# -> db-5.1.29.NC.tar.gz: OK
tar -xzvf db-5.1.29.NC.tar.gz

# Build the library and install to our prefix
cd db-5.1.29.NC/build_unix/
#  Note: Do a static build so that it can be embedded into the executable, instead of having to find a .so at runtime
../dist/configure --enable-cxx --disable-shared --with-pic    --prefix=$BDB_PREFIX
sudo make install

# Configure Dogecoin Core to use our own-built instance of BDB
cd $BITCOIN_ROOT
./configure  LDFLAGS="-L${BDB_PREFIX}/lib/" CPPFLAGS="-  I${BDB_PREFIX}/include/"

=========================================================
4: ./configure
5: make   (Wait to complete it ... .... )
6: sudo make install  (Optional)

 To check if Dogecoind is Installed and Running, Please run

 >> **dogecoind -daemon**

如果您收到此错误:

 Error: To use dogecoind, or the -server option to dogecoin-qt, you must set an rpcpassword in the configuration file:
/root/.dogecoin/dogecoin.conf
It is recommended you use the following random password:
rpcuser= 'username' 
rpcpassword= 'userpassword'
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file     permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %s | mail -s "Dogecoin Alert" admin@foo.com

然后在 ./root/.dogecoin/ 中创建 dogecoin.conf 文件并在其中粘贴以下行

rpcuser= 'username' 
rpcpassword= 'userpassword'
alertnotify=echo %s | mail -s "Dogecoin Alert" youremail@gmail.com
--------------END---------------


 SAMPLE RESULTS AFTER Running 'make'

root@ateq:/home/rails/dogecoin# make
Making all in src
make[1]: Entering directory `/home/rails/dogecoin/src'
make[2]: Entering directory `/home/rails/dogecoin/src'
CXX      crypto/libbitcoinconsensus_la-hmac_sha512.lo
CXX      crypto/libbitcoinconsensus_la-ripemd160.lo
CXX      crypto/libbitcoinconsensus_la-scrypt.lo
CXX      crypto/libbitcoinconsensus_la-sha1.lo
CXX      crypto/libbitcoinconsensus_la-sha256.lo
CXX      crypto/libbitcoinconsensus_la-sha512.lo

.....................

【讨论】:

    猜你喜欢
    • 2013-08-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-18
    相关资源
    最近更新 更多