Sophie259
Sophie259

Reputation: 93

CryptoNote Make Compile Issues Ubuntu

I am following the cryptonote starter about creating a cryptocurrency on its own blockchain. So far so good except that it doesn't compile. I tried both on Ubuntu 18.04 and 16.04 and I am getting the same error. After creating the code as specified in the guidance, I leave the genesis address and click on compile.

When I run make I am getting this error:

    [ 53%] Building CXX object src/CMakeFiles/ConnectivityTool.dir/ConnectivityTool/ConnectivityTool.cpp.o
[ 53%] Linking CXX executable connectivity_tool
/usr/bin/ld: StreamTools.cpp.o: plugin needed to handle lto object
/tmp/ccn2FxVh.ltrans2.ltrans.o: In function `std::_Function_handler<void (), handle_request_stat(boost::program_options::variables_map&, unsigned long long)::{lambda()#4}>::_M_invoke(std::_Any_data const&) [clone .lto_priv.448]':
<artificial>:(.text+0x161b): undefined reference to `Common::write(Common::IOutputStream&, void const*, unsigned int)'
<artificial>:(.text+0x164b): undefined reference to `Common::write(Common::IOutputStream&, void const*, unsigned int)'
<artificial>:(.text+0x1798): undefined reference to `Common::write(Common::IOutputStream&, void const*, unsigned int)'
<artificial>:(.text+0x17d2): undefined reference to `Common::write(Common::IOutputStream&, void const*, unsigned int)'
/tmp/ccn2FxVh.ltrans2.ltrans.o: In function `std::_Function_handler<void (), handle_request_stat(boost::program_options::variables_map&, unsigned long long)::{lambda()#3}>::_M_invoke(std::_Any_data const&) [clone .lto_priv.450]':
<artificial>:(.text+0x1b35): undefined reference to `Common::write(Common::IOutputStream&, void const*, unsigned int)'
/tmp/ccn2FxVh.ltrans2.ltrans.o:<artificial>:(.text+0x1b5b): more undefined references to `Common::write(Common::IOutputStream&, void const*, unsigned int)' follow
/tmp/ccn2FxVh.ltrans27.ltrans.o: In function `(anonymous namespace)::loadSection(Common::IInputStream&) [clone .lto_priv.376]':
<artificial>:(.text+0x391): undefined reference to `Common::read(Common::IInputStream&, unsigned char&)'
<artificial>:(.text+0x3db): undefined reference to `Common::read(Common::IInputStream&, unsigned char&)'
<artificial>:(.text+0x42d): undefined reference to `Common::read(Common::IInputStream&, void*, unsigned int)'
<artificial>:(.text+0x485): undefined reference to `Common::read(Common::IInputStream&, void*, unsigned int)'
<artificial>:(.text+0x4ae): undefined reference to `Common::read(Common::IInputStream&, void*, unsigned int)'
<artificial>:(.text+0x4ed): undefined reference to `Common::read(Common::IInputStream&, unsigned char&)'
<artificial>:(.text+0x52b): undefined reference to `Common::read(Common::IInputStream&, unsigned char&)'
/tmp/ccn2FxVh.ltrans27.ltrans.o: In function `(anonymous namespace)::loadValue(Common::IInputStream&, unsigned char)':
<artificial>:(.text+0x8f4): undefined reference to `Common::read(Common::IInputStream&, unsigned char&)'
<artificial>:(.text+0x961): undefined reference to `Common::read(Common::IInputStream&, void*, unsigned int)'
<artificial>:(.text+0x9c1): undefined reference to `Common::read(Common::IInputStream&, void*, unsigned int)'
<artificial>:(.text+0x9f1): undefined reference to `Common::read(Common::IInputStream&, void*, unsigned int)'
<artificial>:(.text+0xa11): undefined reference to `Common::read(Common::IInputStream&, void*, unsigned int)'
<artificial>:(.text+0xa31): undefined reference to `Common::read(Common::IInputStream&, void*, unsigned int)'
/tmp/ccn2FxVh.ltrans27.ltrans.o:<artificial>:(.text+0xa51): more undefined references to `Common::read(Common::IInputStream&, void*, unsigned int)' follow
/tmp/ccn2FxVh.ltrans27.ltrans.o: In function `(anonymous namespace)::loadValue(Common::IInputStream&, unsigned char)':
<artificial>:(.text+0xb5c): undefined reference to `Common::read(Common::IInputStream&, unsigned char&)'
<artificial>:(.text+0xb98): undefined reference to `Common::read(Common::IInputStream&, unsigned char&)'
<artificial>:(.text+0xc29): undefined reference to `Common::read(Common::IInputStream&, unsigned char&)'
<artificial>:(.text+0xcb9): undefined reference to `Common::read(Common::IInputStream&, unsigned char&)'
<artificial>:(.text+0xcf9): undefined reference to `Common::read(Common::IInputStream&, void*, unsigned int)'
/tmp/ccn2FxVh.ltrans29.ltrans.o: In function `CryptoNote::KVBinaryInputStreamSerializer::KVBinaryInputStreamSerializer(Common::IInputStream&)':
<artificial>:(.text+0x1087): undefined reference to `Common::read(Common::IInputStream&, void*, unsigned int)'
collect2: error: ld returned 1 exit status
src/CMakeFiles/ConnectivityTool.dir/build.make:113: recipe for target 'src/connectivity_tool' failed
make[3]: *** [src/connectivity_tool] Error 1
make[3]: Leaving directory '/home/user/Desktop/mycoin/build/release'
CMakeFiles/Makefile2:415: recipe for target 'src/CMakeFiles/ConnectivityTool.dir/all' failed
make[2]: *** [src/CMakeFiles/ConnectivityTool.dir/all] Error 2
make[2]: Leaving directory '/home/user/Desktop/mycoin/build/release'
Makefile:94: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/user/Desktop/mycoin/build/release'
Makefile:20: recipe for target 'build-release' failed
make: *** [build-release] Error 2

Apparently this is a well known error that other people have, yet nobody posted a solution. Example of people with the error in compiling: Example 1 Example 2

I found an alternative solution that I'd rather not use. A user suggested:

Here is one that you can setup without errors on latest Ubuntu https://github.com/Matthuffy/eightcoin

However that version is different from the original (it has more coding parameters where you have to specify the minimum coin value, etc.). I'd rather stick to the official guidance in the cryptonote starter. This one compiled successfully

Keep in mind that I installed the following dependencies yet it doesn't work:

sudo apt install build-essential libqt4-dev qt5-qmake cmake qttools5-dev libqt5webkit5-dev qttools5-dev-tools qt5-default python-sphinx texlive-latex-base inotify-tools openssl libssl-dev libdb++-dev libminiupnpc-dev git sqlite3 libsqlite3-dev g++ libpng-dev gedit python gcc make libbz2-dev libdb-dev libssl-dev libreadline-dev autoconf libtool libleveldb-dev libblkid-dev e2fslibs-dev libboost-all-dev libaudit-dev nano qtbase5-dev qt4-dev-tools libqtcore4 libqtgui4 automake -y

I need a solution to be able to compile from https://cryptonotestarter.org/inner.html

Other information you may want to know from my actual os (ubuntu 16.04):

make -v
GNU Make 4.1

dpkg -s libboost-dev | grep 'Version'
Version: 1.58.0.1ubuntu1

Upvotes: 0

Views: 527

Answers (1)

developers prb
developers prb

Reputation: 36

let me tell you that I had that same error, but looking for a solution and investigating, I could finally find how to solve this problem.

you must delete

set (RELEASE_FLAGS "$ {RELEASE_FLAGS} -flto")

or just put a # before it, this way

#set (RELEASE_FLAGS "$ {RELEASE_FLAGS} -flto")

this can be found in CMakeList.txt

you must run it as follows

 sudo make -j

I suggest you place the number of threads because if you do it that way and you are using a virtual machine you can leave it paralyzed or slow down, I think it does not matter the speed at which it is being compiled, but if the work is done correctly. I hope I can help you.

Upvotes: 2

Related Questions