【发布时间】:2020-08-22 02:27:41
【问题描述】:
我一直在尝试为使用boost build 进行编译的树莓派交叉编译jlibtorrent。我正在使用the officially provided cross compiler 和以下config.jam:
import os ;
using gcc : arm : arm-linux-gnueabihf-g++ :
<cxxflags>-fPIC
<cxxflags>-std=c++14
<cxxflags>-fno-strict-aliasing
<cxxflags>-fvisibility=hidden
<linkflags>-m32
<linkflags>-static-libstdc++
<linkflags>-static-libgcc
<linkflags>"-z noexecstack"
# debug information
<cxxflags>-g
<cxxflags>-gdwarf-4
<cxxflags>-ggdb
;
我基本上复制了 linux-x86 的现有配置并更换了编译器,但我收到以下编译错误:
libtorrent/src/entry.cpp: In member function 'libtorrent::entry& libtorrent::entry::operator[](libtorrent::string_view)':
libtorrent/src/entry.cpp:86:33: error: no matching function for call to
'std::map<std::basic_string<char>, libtorrent::entry, libtorrent::aux::strview_less, std::allocator<std::pair<const std::basic_string<char>, libtorrent::entry> > >::find(libtorrent::string_view&)'
auto const i = dict().find(key);
我唯一的猜测是交叉编译器的版本(4.9.3)与libtorrent不兼容,因为我在linux-32-config.jam中看到它使用了g++-5。还有什么我想念的吗?
您可以找到修改后的存储库in my github repositories。我正在使用swig/build-linux-armv7.sh 进行构建。
【问题讨论】:
-
作为一个有点不相关的注释。 Jamfile 工具集并不意味着包含 c++ 版本、-fPIC、-g 和 -static-*。你可以在 b2 命令行上控制它:debug-symbols=on runtime-link=static cxxstd=14。此外,libtorrent 支持 C++ 别名规则,因此技术上没有必要禁用它们
标签: c++ boost libtorrent boost-build libtorrent-rasterbar