无法使用 CXX 支持编译 BerkeleyDB

问题描述

我正在尝试构建狗狗币客户端。我遵循了他们的所有说明,直到我需要安装 BerkeleyDB。

DogeCoin 要求提供 BerkeleyDB 5.1.29,但 brew 不允许我安装该版本,所以我从 http://download.oracle.com/berkeley-db/db-5.1.29.tar.gz 下载了它,如 here 所述。

我配置了代码并运行了 make && make install,它确实有效,但狗狗币需要 CXX 标头,所以我再次运行了 ../dist/configure,这次使用了选项 --enable-cxx。>

但是,现在我收到了一大堆错误: (在 MacOS Big Sur 11.2.3 上)

/Library/Developer/CommandLinetools/usr/bin/ranlib: file: .libs/libdb-5.1.a(seq_stat.o) has no symbols
/Library/Developer/CommandLinetools/usr/bin/ranlib: file: .libs/libdb-5.1.a(snprintf.o) has no symbols
libtool: link: ranlib .libs/libdb-5.1.a
/Library/Developer/CommandLinetools/usr/bin/ranlib: file: .libs/libdb-5.1.a(seq_stat.o) has no symbols
/Library/Developer/CommandLinetools/usr/bin/ranlib: file: .libs/libdb-5.1.a(snprintf.o) has no symbols
libtool: link: ( cd ".libs" && rm -f "libdb-5.1.la" && ln -s "../libdb-5.1.la" "libdb-5.1.la" )
rm -f libdb.a
ln -s .libs/libdb-5.1.a libdb.a
./libtool --mode=compile g++ -c -I. -I../src  -O ../lang/cxx/cxx_db.cpp
libtool: compile:  g++ -c -I. -I../src -O ../lang/cxx/cxx_db.cpp  -fno-common -DPIC -o .libs/cxx_db.o
In file included from ../lang/cxx/cxx_db.cpp:13:
In file included from ./db_cxx.h:55:
In file included from /Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/iostream:37:
In file included from /Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/ios:215:
In file included from /Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/__locale:14:
In file included from /Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/string:504:
In file included from /Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/string_view:175:
In file included from /Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/__string:57:
In file included from /Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/algorithm:643:
In file included from /Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/memory:666:
/Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/atomic:1742:13: error: expected unqualified-id
atomic_init(volatile atomic<_Tp>* __o,_Tp __d) _NOEXCEPT
            ^
/Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/atomic:1742:13: error: expected ')'
/Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/atomic:1742:1: note: to match this '('
atomic_init(volatile atomic<_Tp>* __o,_Tp __d) _NOEXCEPT
^
../src/dbinc/atomic.h:73:30: note: expanded from macro 'atomic_init'
#define atomic_init(p,val)     ((p)->value = (val))
                                 ^
In file included from ../lang/cxx/cxx_db.cpp:13:
In file included from ./db_cxx.h:55:
In file included from /Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/iostream:37:
In file included from /Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/ios:215:
In file included from /Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/__locale:14:
In file included from /Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/string:504:
In file included from /Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/string_view:175:
In file included from /Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/__string:57:
In file included from /Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/algorithm:643:
In file included from /Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/memory:666:
/Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/atomic:1742:1: error: expected ')'
atomic_init(volatile atomic<_Tp>* __o,_Tp __d) _NOEXCEPT
^
../src/dbinc/atomic.h:73:33: note: expanded from macro 'atomic_init'
#define atomic_init(p,val)     ((p)->value = (val))
                                    ^
/Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/atomic:1742:1: note: to match this '('
../src/dbinc/atomic.h:73:29: note: expanded from macro 'atomic_init'
#define atomic_init(p,val)     ((p)->value = (val))
                                ^
In file included from ../lang/cxx/cxx_db.cpp:13:
In file included from ./db_cxx.h:55:
In file included from /Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/iostream:37:
In file included from /Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/ios:215:
In file included from /Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/__locale:14:
In file included from /Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/string:504:
In file included from /Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/string_view:175:
In file included from /Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/__string:57:
In file included from /Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/algorithm:643:
In file included from /Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/memory:666:
/Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/atomic:2315:35: error: unkNown type name 'atomic_flag'
atomic_flag_test_and_set(volatile atomic_flag* __o) _NOEXCEPT
                                  ^
/Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/atomic:2322:26: error: unkNown type name 'atomic_flag'
atomic_flag_test_and_set(atomic_flag* __o) _NOEXCEPT
                         ^
/Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/atomic:2329:44: error: unkNown type name 'atomic_flag'
atomic_flag_test_and_set_explicit(volatile atomic_flag* __o,memory_order __m) _NOEXCEPT
                                           ^
/Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/atomic:2336:35: error: unkNown type name 'atomic_flag'
atomic_flag_test_and_set_explicit(atomic_flag* __o,memory_order __m) _NOEXCEPT
                                  ^
/Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/atomic:2343:28: error: unkNown type name 'atomic_flag'
atomic_flag_clear(volatile atomic_flag* __o) _NOEXCEPT
                           ^
/Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/atomic:2350:19: error: unkNown type name 'atomic_flag'
atomic_flag_clear(atomic_flag* __o) _NOEXCEPT
                  ^
/Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/atomic:2357:37: error: unkNown type name 'atomic_flag'
atomic_flag_clear_explicit(volatile atomic_flag* __o,memory_order __m) _NOEXCEPT
                                    ^
/Library/Developer/CommandLinetools/usr/bin/../include/c++/v1/atomic:2364:28: error: unkNown type name 'atomic_flag'
atomic_flag_clear_explicit(atomic_flag* __o,memory_order __m) _NOEXCEPT
                           ^
11 errors generated.
make: *** [cxx_db.lo] Error 1

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)