簡體   English   中英

樹莓派 3 model B 的交叉編譯 libtorrent

[英]Cross compiling libtorrent for raspberry pi 3 model B

我一直在嘗試為使用boost build進行編譯的樹莓派交叉編譯jlibtorrent 我正在使用帶有以下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。 還有什么我想念的嗎? 您可以在我的 github repositories 中找到修改后的存儲庫。 我正在使用swig/build-linux-armv7.sh進行構建。

該調用 (std::map::find()) 被添加到 C++14 中(參見文檔)。 我看到你也在命令行上傳遞了-std=c++14 您確定您的 GCC 支持 C++14 嗎? 這似乎有點老了。

libtorrent 當前的穩定分支只需要 C++11 支持,如果這是您正在構建的分支,則此處的編譯器支持檢測可能有問題。 如果您從 libtorrent master構建,則需要適當的 C++14 支持。 因此,在這種情況下,您可能需要使用穩定版本。

感謝@Arvid,我設法使用 libtorrent (RC_1_2) 的當前穩定分支和以下 jam 文件來編譯它,您可以在此處找到。

import os ;

using gcc : arm : arm-linux-gnueabihf-g++ :
    <cxxflags>-fPIC
    <cxxflags>-std=c++11
    <cxxflags>-fno-strict-aliasing
    <cxxflags>-fvisibility=hidden
    <linkflags>-static-libstdc++
    <linkflags>-static-libgcc
    <linkflags>"-z noexecstack"
    # debug information
    <cxxflags>-g
    <cxxflags>-gdwarf-4
    <cxxflags>-ggdb;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM