首页 > 解决方案 > 无法使用 CXX 支持编译 BerkeleyDB

问题描述

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

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

我配置了代码并运行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

标签: c++berkeley-db

解决方案


推荐阅读