gpt4 book ai didi

c++ - CryptoNote 使编译问题 Ubuntu

转载 作者:行者123 更新时间:2023-12-04 19:00:14 25 4
gpt4 key购买 nike

我正在关注 cryptonote starter关于在自己的区 block 链上创建加密货币。到目前为止一切顺利,只是它无法编译。我在 Ubuntu 18.04 和 16.04 上都试过了,我得到了同样的错误。按照指南中的说明创建代码后,我留下创世地址并点击编译。

当我运行 make 我得到这个错误:

    [ 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

显然,这是其他人的一个众所周知的错误,但没有人发布解决方案。
编译错误的人的例子:
Example 1
Example 2

我找到了一个我不想使用的替代解决方案。一位用户建议:

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



但是,该版本与原始版本不同(它具有更多编码参数,您必须在其中指定最小硬币值等)。我宁愿坚持cryptonote starter中的官方指导。这个编译成功

请记住,我安装了以下依赖项但它不起作用:

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



我需要一个能够从 https://cryptonotestarter.org/inner.html 编译的解决方案

您可能想从我的实际操作系统(ubuntu 16.04)中了解的其他信息:
make -v
GNU Make 4.1

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

最佳答案

让我告诉你我有同样的错误,但是寻找解决方案并进行调查,我终于找到了解决这个问题的方法。

你必须删除
set (RELEASE_FLAGS "$ {RELEASE_FLAGS} -flto")
或者只是在它前面放一个#,这样
#set (RELEASE_FLAGS "$ {RELEASE_FLAGS} -flto")
这可以在 CMakeList.txt 中找到

您必须按如下方式运行它

 sudo make -j

我建议您设置线程数,因为如果您这样做并且您使用的是虚拟机,您可能会使其瘫痪或减慢速度,我认为编译速度并不重要,但如果工作正确完成。
我希望我能帮助你。

关于c++ - CryptoNote 使编译问题 Ubuntu,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57289217/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com