1. Please post the full error message including source code if it is given.
2. Please tell us what program you are compiling (Bitcoin Core?)
i solved this error by enter dbinc and atomic.h and edit atomic_compare_exchange to atomic_compare_exchange_db in atomic.h .
Um... No. Don't modify the Bitcoin source code to fix compiling errors..
It compiles
just fine providing
your setup (dependencies, hardware, ...) is good. Working around such issues by modifying the source is not the way to go.
Now I compile bitcoin core by following commands
cd bitcoin
./autogen.sh
sudo chmod -R 775 /root/bitcoin/
First of all, I wouldn't recommend running Bitcoin Core as root user, nor installing it as user
root.
./autogen.sh
./configure CPPFLAGS="-I${BDB_PREFIX}/include/ -O2" LDFLAGS="-L${BDB_PREFIX}/lib/"
make
Why don't you use the default build commands from the documentation?
https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.mdwhen command make , it show error again . this is
g++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
make[2]: *** [Makefile:9605: libbitcoin_node_a-init.o] Error 1
make[2]: Leaving directory '/root/bitcoin/src'
make[1]: *** [Makefile:18946: all-recursive] Error 1
make[1]: Leaving directory '/root/bitcoin/src'
make: *** [Makefile:821: all-recursive] Error 1
why this happen ?
This is again not the complete error message, though, right.
You seem to be running out of memory during compilation. How much RAM do you have, and how are you calling
make (e.g. make -j4)? A single thread requires about 2GB of memory for compiling Bitcoin Core.
If you are just using make with one thread (no -j argument), you can try
adding temporary swap space, but I don't recommend this.
RAM 1GB cannot handle bitcoin core. Right ? just simply call by ``` make ``` . if increase RAM GB , it will be ok . right?
It is recommended to have 1.5GB at the very least, but you can tune compiler flags.
C++ compilers are memory-hungry. It is recommended to have at least 1.5 GB of memory available when compiling Bitcoin Core. On systems with less, gcc can be tuned to conserve memory with additional CXXFLAGS:
[...]