devcoin / core

Devcoin (DVC) - From the many, one. From one, the source
http://www.devcoin.org
MIT License
19 stars 18 forks source link

Can't compile wallet in Lubuntu 20.04.1 #87

Closed cpsilent closed 3 years ago

cpsilent commented 4 years ago

I did compile the wallet in Lubuntu 16.04.3 successfully using a Virtual Machine. However, while trying to move it to a system with Linux Mint 20 (based on Ubuntu 20.04) it didn't run. So, after a while trying unsuccessfully to compile the wallet, I decided to compile it on a Virtual Machine using Lubuntu 20.04.1 (also based on Ubuntu 20.04) with the same results as in Linux Mint 20. Researching about it, it seems that it needs libboost 1.54.0, but it's no longer available in repositories and I couldn't successfully compile it on my system.

For the compiling process I used these instructions: https://hive.blog/busy/@cpol/how-to-compile-your-very-own-devcoin-wallet-in-ubuntu-18-04

Here is the output when I executed the make -f makefile.unix USE_UPNP=- command:

test@test-virtualbox:home/test/core/src$ make -f makefile.unix USE_UPNP=- /bin/sh ../share/genbuild.sh obj/build.h g++ -c -O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -g -DBOOST_SPIRIT_THREADSAFE -D_FILE_OFFSET_BITS=64 -I/home/test/core/src -I/home/test/core/src/obj -DUSE_IPV6=1 -I/home/test/core/src/leveldb/include -I/home/test/core/src/leveldb/helpers -I/home/test/core/src/curl/include -DHAVE_BUILD_INFO -fno-stack-protector -fstack-protector-all -Wstack-protector -D_FORTIFY_SOURCE=2 -MMD -MF obj/bitcoinrpc.d -o obj/bitcoinrpc.o bitcoinrpc.cpp In file included from wallet.h:13, from init.h:8, from bitcoinrpc.cpp:6: main.h: In constructor ‘CTxIn::CTxIn(COutPoint, CScript, unsigned int)’: main.h:332:21: warning: implicitly-declared ‘CScript& CScript::operator=(const CScript&)’ is deprecated [-Wdeprecated-copy] 332 | scriptSig = scriptSigIn; | ^~~ In file included from main.h:11, from wallet.h:13, from init.h:8, from bitcoinrpc.cpp:6: script.h:277:5: note: because ‘CScript’ has user-provided ‘CScript::CScript(const CScript&)’ 277 | CScript(const CScript& b) : std::vector(b.begin(), b.end()) { } | ^~~ In file included from wallet.h:13, from init.h:8, from bitcoinrpc.cpp:6: main.h: In constructor ‘CTxIn::CTxIn(uint256, unsigned int, CScript, unsigned int)’: main.h:339:21: warning: implicitly-declared ‘CScript& CScript::operator=(const CScript&)’ is deprecated [-Wdeprecated-copy] 339 | scriptSig = scriptSigIn; | ^~~ In file included from main.h:11, from wallet.h:13, from init.h:8, from bitcoinrpc.cpp:6: script.h:277:5: note: because ‘CScript’ has user-provided ‘CScript::CScript(const CScript&)’ 277 | CScript(const CScript& b) : std::vector(b.begin(), b.end()) { } | ^~~ In file included from wallet.h:13, from init.h:8, from bitcoinrpc.cpp:6: main.h: In constructor ‘CTxOut::CTxOut(int64, CScript)’: main.h:408:24: warning: implicitly-declared ‘CScript& CScript::operator=(const CScript&)’ is deprecated [-Wdeprecated-copy] 408 | scriptPubKey = scriptPubKeyIn; | ^~~~~~ In file included from main.h:11, from wallet.h:13, from init.h:8, from bitcoinrpc.cpp:6: script.h:277:5: note: because ‘CScript’ has user-provided ‘CScript::CScript(const CScript&)’ 277 | CScript(const CScript& b) : std::vector(b.begin(), b.end()) { } | ^~~ In file included from wallet.h:13, from init.h:8, from bitcoinrpc.cpp:6: main.h: In member function ‘CTxOut& CTxOut::operator=(CTxOut&&)’: main.h:394:7: warning: implicitly-declared ‘CScript& CScript::operator=(const CScript&)’ is deprecated [-Wdeprecated-copy] 394 | class CTxOut | ^~ In file included from main.h:11, from wallet.h:13, from init.h:8, from bitcoinrpc.cpp:6: script.h:277:5: note: because ‘CScript’ has user-provided ‘CScript::CScript(const CScript&)’ 277 | CScript(const CScript& b) : std::vector(b.begin(), b.end()) { } | ^~~ In file included from wallet.h:13, from init.h:8, from bitcoinrpc.cpp:6: main.h: In member function ‘CTxInUndo& CTxInUndo::operator=(CTxInUndo&&)’: main.h:712:7: note: synthesized method ‘CTxOut& CTxOut::operator=(CTxOut&&)’ first required here 712 | class CTxInUndo | ^~~~~ main.h: In member function ‘bool CCoins::Spend(const COutPoint&, CTxInUndo&)’: main.h:1047:37: note: synthesized method ‘CTxInUndo& CTxInUndo::operator=(CTxInUndo&&)’ first required here 1047 | undo = CTxInUndo(vout[out.n]); | ^ In file included from bitcoinrpc.h:17, from bitcoinrpc.cpp:12: json/json_spirit_writer_template.h: In function ‘String_type json_spirit::non_printable_to_string(unsigned int)’: json/json_spirit_writer_template.h:31:50: warning: typedef ‘Char_type’ locally defined but not used [-Wunused-local-typedefs] 31 | typedef typename String_type::value_type Char_type; | ^~~~~ bitcoinrpc.cpp: In function ‘void StartRPCThreads()’: bitcoinrpc.cpp:793:77: error: no matching function for call to ‘boost::asio::ssl::context::context(boost::asio::io_service&, boost::asio::ssl::context_base::method)’ 793 | rpc_ssl_context = new ssl::context(rpc_io_service, ssl::context::sslv23); | ^ In file included from /usr/include/boost/asio/ssl/context.hpp:757, from /usr/include/boost/asio/ssl.hpp:18, from bitcoinrpc.cpp:24: /usr/include/boost/asio/ssl/impl/context.ipp:371:1: note: candidate: ‘boost::asio::ssl::context::context(boost::asio::ssl::context&&)’ 371 | context::context(context&& other) | ^~~ /usr/include/boost/asio/ssl/impl/context.ipp:371:1: note: candidate expects 1 argument, 2 provided /usr/include/boost/asio/ssl/impl/context.ipp:63:1: note: candidate: ‘boost::asio::ssl::context::context(boost::asio::ssl::context_base::method)’ 63 | context::context(context::method m) | ^~~ /usr/include/boost/asio/ssl/impl/context.ipp:63:1: note: candidate expects 1 argument, 2 provided bitcoinrpc.cpp:812:50: error: ‘class boost::asio::ssl::context’ has no member named ‘impl’ 812 | SSL_CTX_set_cipher_list(rpc_ssl_context->impl(), strCiphers.c_str()); | ^~~~ bitcoinrpc.cpp: In function ‘json_spirit::Object CallRPC(const string&, const Array&)’: bitcoinrpc.cpp:1091:58: error: no matching function for call to ‘boost::asio::ssl::context::context(boost::asio::io_service&, boost::asio::ssl::context_base::method)’ 1091 | ssl::context context(io_service, ssl::context::sslv23); | ^ In file included from /usr/include/boost/asio/ssl/context.hpp:757, from /usr/include/boost/asio/ssl.hpp:18, from bitcoinrpc.cpp:24: /usr/include/boost/asio/ssl/impl/context.ipp:371:1: note: candidate: ‘boost::asio::ssl::context::context(boost::asio::ssl::context&&)’ 371 | context::context(context&& other) | ^~~ /usr/include/boost/asio/ssl/impl/context.ipp:371:1: note: candidate expects 1 argument, 2 provided /usr/include/boost/asio/ssl/impl/context.ipp:63:1: note: candidate: ‘boost::asio::ssl::context::context(boost::asio::ssl::context_base::method)’ 63 | context::context(context::method m) | ^~~ /usr/include/boost/asio/ssl/impl/context.ipp:63:1: note: candidate expects 1 argument, 2 provided bitcoinrpc.cpp: In instantiation of ‘void RPCListen(boost::shared_ptr<boost::asio::basic_socket_acceptor<Protocol, SocketAcceptorService> >, boost::asio::ssl::context&, bool) [with Protocol = boost::asio::ip::tcp; SocketAcceptorService = boost::asio::executor]’: bitcoinrpc.cpp:835:54: required from here bitcoinrpc.cpp:704:93: error: ‘class boost::asio::basic_socket_acceptor’ has no member named ‘get_io_service’ 704 | AcceptedConnectionImpl conn = new AcceptedConnectionImpl(acceptor->get_io_service(), context, fUseSSL); | ~~^~~~~~ bitcoinrpc.cpp: In instantiation of ‘bool SSLIOStreamDevice::connect(const string&, const string&) [with Protocol = boost::asio::ip::tcp; std::string = std::__cxx11::basic_string]’: bitcoinrpc.cpp:1096:103: required from here bitcoinrpc.cpp:617:43: error: ‘class boost::asio::ssl::stream<boost::asio::basic_stream_socket >’ has no member named ‘get_io_service’ 617 | ip::tcp::resolver resolver(stream.get_io_service()); | ~^~~~ make: *** [makefile.unix:182: obj/bitcoinrpc.o] Error 1 test@test-virtualbox:/home/test/core/src$

develCuy commented 4 years ago

@cpsilent, if this has been resolved with latest changes at #80, then please close this issue

cpsilent commented 4 years ago

Unfortunately, it hasn't. However, please note that I'm using a different set of instructions to build it. I need to figure out how to build the linux version deviating a little bit of the instructions set located at #80.

develCuy commented 4 years ago

@cpsilent, we have reached a point where we can't upgrade dependencies and stay compatible current linux distros. The only way is to build statically linked binaries, which is the last resource. Can you try to build this experimental release of devcoin? https://github.com/devcoin/core/tree/devcoin0.9.2. Notice that the branch is devcoin0.9.2, so you have to do this: git clone --branch=devcoin0.9.2

cpsilent commented 4 years ago

The problem is I'm not sure how to build it statically for linux. I had tried changing the target os in some of those commands to no avail. That's something that goes beyond my knowledge and search skills. What can I do besides those changes to make it work on linux? After the devcoind compilation, it would be possible to compile the GUI using the instructions on Steemit/Hive or should I do that statically also? Thank you @develCuy!

develCuy commented 4 years ago

@cpsilent please compile 0.9.2 with the instructions from steemit/hive, don't worry about statically linked binaries right now

cpsilent commented 4 years ago

I downloaded the new branch files and when I tried to compile it, it showed the following error: make: makefile.unix: No such file or directory make: *** No rule to make target 'makefile.unix'. Stop.

develCuy commented 4 years ago

Can you try this instructions instead: https://github.com/devcoin/core/blob/devcoin0.9.2/doc/build-unix.md

cpsilent commented 4 years ago

At the end of this comment I will attach .txt files with the output problems.

I used the option to configure --with-incompatible-bdb, because the ppa added in the instructions doesn't have a Berkeley DB 4.8 package for the current os version (Focal Fossa which is the one Linux Mint Ulyana is based on), so, it was suggested to add that option in configure, in case there were no way to install that version. I added the --with-gui=qt5 option because there aren't qt4 libs in the current repositories anymore.

Some other issues I found:

Configuration output: compilation_2020-09-24-23_23.txt

older777 commented 3 years ago

Hi. There's some compile issue on v0.8.8.0 compile in the Linux Mint 20.2 (Ubuntu Focal). Some problem is appear during compile. You have to install DB Berkley 4.8, 4.8++ from the sources (bash, article) and remove libdb5.3 before compilation: sudo apt remove libdb5.3++ libdb5.3++-dev In attached patch compile fix for Linux in src/bitcoinrpc.cpp file (not my own patches, not tested, just got solution from the other Coins). Added missed boost's libraries. Off some libcurl's libs. My Boost version 1.71.0, gcc version 9.3.0.

Compile keys Devcoin-qt: qmake USE_QRCODE=- USE_UPNP=- devcoin-qt.pro && make clean && make Devcoind: cd src && make -f makefile.unix clean && make -f makefile.unix

Compilation is OK, not tested but look like works fine and it updating the Devcoin blockchain.

PATCH Compile-fix-for-Linux-Mint.txt

develCuy commented 3 years ago

@cpsilent, can you check @older777's instructions and provide test results?

cpsilent commented 3 years ago

I tried to patch the file src/bitcoinrpc.cpp but the output was:

`~/core/src$ patch -p1 < bitcoinrpc.patch can't find file to patch at input line 5 Perhaps you used the wrong -p or --strip option? The text leading up to this was:

|diff --git a/devcoin-qt.pro b/devcoin-qt.pro |index 455251e..acade3f 100644 |--- a/devcoin-qt.pro |+++ b/devcoin-qt.pro

File to patch: bitcoinrpc.cpp patching file bitcoinrpc.cpp Hunk #1 FAILED at 428. 1 out of 1 hunk FAILED -- saving rejects to file bitcoinrpc.cpp.rej can't find file to patch at input line 18 Perhaps you used the wrong -p or --strip option? The text leading up to this was:

|diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp |index 354e03c..5836992 100644 |--- a/src/bitcoinrpc.cpp |+++ b/src/bitcoinrpc.cpp

` What I'm doing wrong? By the way, I have to switch to Kubuntu 20.04.3 LTS, because I lost my old SSD.

older777 commented 3 years ago

I tried to patch the file src/bitcoinrpc.cpp but the output was: ~/core/src$ patch -p1 < bitcoinrpc.patch

I think you have to go upper folder before patch ~/core$

older777 commented 3 years ago

Got any success? Look, the Devcoin install instruction wallet runs on Qt4. But Qt4 a bit obsolete. So let me note about of compilation for Qt5. Pls install next tools: sudo apt-get install libqt5core5a qt5-qmake qtpositioning5-dev qt5-default qttools5-dev-tools Compiled, works good. qt5

cpsilent commented 3 years ago

Got any success? Look, the Devcoin install instruction wallet runs on Qt4. But Qt4 a bit obsolete. So let me note about of compilation for Qt5. Pls install next tools: sudo apt-get install libqt5core5a qt5-qmake qtpositioning5-dev qt5-default qttools5-dev-tools Compiled, works good.

I applied the patch successfully, but the compile process ended in error. Please refer to the file compiling01.txt for further details. I will install the other tools you mentioned as soon as I can solve the compiling problem. Am I using the wrong branch? I'm using master at the moment. Thank you!

older777 commented 3 years ago

I applied the patch successfully, but the compile process ended in error.

The header file db_cxx.h means you didn't install DB Berkley 4.8, 4.8++? Try locate file: art@art:/$ locate db_cxx.h it should be something like /include/db_cxx.h /usr/local/docs/programmer_reference/upgrade_3_0_db_cxx.html /usr/local/include/db_cxx.h

If not found please look for previous message

cpsilent commented 3 years ago

Compiling process is successful in Kubuntu 20.04.3 LTS! Screenshot_20210928_234437

However, it shows me this error below and gets close

:~/core$ ./devcoin-qt 
DEBUG: Fetching http://galaxies.mygamesonline.org/receiver_94.csv ... got 7758 bytes

DEBUG: Fetching http://devcoinpool.btc-music.com/receiver/receiver_94.csv ... got 0 bytes

DEBUG: Fetching http://devcoin.darkgamex.ch/receiver_94.csv ... got 7758 bytes

DEBUG: Fetching http://d.evco.in/receiver/receiver_94.csv ... got 7758 bytes

DEBUG: Fetching http://show-me-the-devcoin.info/devtome/receiver_94.csv ... got 2057 bytes

DEBUG: Fetching http://node1.devcoin.cloud/receiver_files/receiver_94.csv ... got 0 bytes

DEBUG: Fetching http://jerpat.us/dcr/uploads/receiver_94.csv ... got 7813 bytes

Number of pages in getCommonOutputByText: 7
DEBUG: Identical pages in getCommonOutputByText: 1

DEBUG: Identical pages in getCommonOutputByText: 3

Insufficient identical pages in getCommonOutputByText.
Warning, writeFileText in receiver.h won't write the file:
/home/username/.devcoin/receiver/receiver_94.csv
because the text is blank.
No coin addresses were found, there may be something wrong with the receiver_x.csv files.

QFileSystemWatcher::removePaths: list is empty
QFileSystemWatcher::removePaths: list is empty

Should I try another branch to make it run properly? Thank you so much!

older777 commented 3 years ago

Great @cpsilent! Got errors cuz some nodes are dead in the list :) try download blockchain by the devcoind 👍

If blockchain is still able to get, so currency still alive yet. IMHO just necessary fix errors and make wallet able for any new OS. And everything would be OK. Am I right, @develCuy ? 😉

Satoshi0x commented 3 years ago

Great @cpsilent! Got errors cuz some nodes are dead in the list :) try download blockchain by the devcoind 👍

If blockchain is still able to get, so currency still alive yet. IMHO just necessary fix errors and make wallet able for any new OS. And everything would be OK. Am I right, @develCuy ? 😉

heh some nodes are dead... I think most of the data when I delete my debug log is trying to connect to dead nodes! :) but we're here great job guys 🥇

cpsilent commented 3 years ago

Nice! Since the compilation process was a success in Linux and since the problem is unrelated to this issue, I will close this issue and I considered it as solved. I imagine you guys already opened a new issue related with those dead nodes. Thank you so much for all your help in getting this fixed!!!