为 armhf 交叉编译 Apache Thrift 程序

标签 cross-compiling thrift beagleboard

我在 x86 上试图交叉编译一个用 C++ 编写的用于 armhf 的 apache thrift 程序。我通过 gcc-arm-linux-gnueabihf 安装了 g++-arm-linux-gnueabihfapt-get ,但是当我使用它们来编译我的程序时,我得到
skipping incompatible /usr/local/lib/libthrift.so when searching for -lthrift
所以我尝试配置 thrift 来编译一个 armhf 兼容的 libthrift.so 使用 this guide ,所以在 bash 中:
./configure CXX=arm-linux-gnueabihf-g++ CC=arm-linux-gnueabihf-gcc --prefix=/BBB/thrift --host=arm-linux-gnueabihf --with-cpp CFLAGS="-g -O2 -I$DIR/include" LDFLAGS="-L$DIR/lib
但后来我得到了:
checking for libevent >= 1.0... configure: error: in 'home/xic/thrift-0.9.0': configure: error: cannot run test program while cross compiling
所以后来我成功编译了 libevent ,但它仍然不起作用。查看 thrift 的 config.log ,我明白了
/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lfl collect2: ld returned 1 exit status
所以显然我也需要交叉编译 flex。这真的是最好的方法,还是有任何更快/更简单的方法?

附:我正在交叉编译 Beaglebone Black,它使用 armhf

最佳答案

Thrift 0.9.0 因交叉编译而被破坏 - 它在 Autoconf 测试脚本中有大量静态路径。

他们的 Jira 中有一个关于这个主题的错误,但事情并没有取得很大进展(基本上是问我是否设置了所有东西的 --includedir ......(提示:交叉编译不会让你在在 Autotools 配置中,他们应该做的第一件事就是寻找主机外的固定路径))

您无法关闭比这更糟糕的 PHP 构建。惭愧,真的,我有点需要一个一站式商店,谷歌和整个社区已经放弃了这个(RPC 是一个笑话......有多少不同的实现 - 它们都不支持 C/同时兼容 C++/Python/C#...)。

关于为 armhf 交叉编译 Apache Thrift 程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17799753/

相关文章:

c++ - Raspberry 交叉编译的链接器错误

c++ - 为 arm : c++: error: unrecognized command line option ‘-mthumb’ ; did you mean ‘-mtbm’ ? 交叉编译 opencv

c - 无需交叉编译的嵌入式 C 代码和单元测试

java - 在 cassandra 中创建计数器列族?

json - 通过 HTTP POST 编码二进制数据的最有效方法是什么

c - 为什么我的 Thrift (c_glib) 客户端失败并出现 "invalid pointer"错误?

opencv - BeagleBone、OpenCV 和网络摄像头问题

c++ - 如何控制 beaglebone GPIO 引脚

linux - buildroot rootfs 可以使用 opkg 安装 angstrom 包吗?

android - 在 Android NDK 中使用静态库时出错