【问题标题】:compiling rtmpdump for arm为arm编译rtmpdump
【发布时间】:2012-06-26 16:07:29
【问题描述】:

我正在尝试为 Qnap NAS 419p (arm) 编译 rtmpdump (http://rtmpdump.mplayerhq.hu/)

我对 linux 或编译不是很熟悉,但我正在努力学习。

make 抱怨找不到 openssl,我不知道从哪里开始?

[/share/Qdownload/src] # ipkg install openssl
Package openssl (0.9.8v-2) installed in root is up to date.
Nothing to be done
Successfully terminated.

确认我已经安装了 openssl

[/share/Qdownload/src] #
[/share/Qdownload/src] # ipkg install zlib
Package zlib (1.2.5-1) installed in root is up to date.
Nothing to be done
Successfully terminated.
[/share/Qdownload/src] #

确认我有 zlib 我认为我需要的唯一其他依赖。

[/share/Qdownload/src] # make linux
make[1]: Entering directory `/share/MD0_DATA/Qdownload/src'
g++ -Wall   -O2   -c -o rtmp.o rtmp.cpp
In file included from rtmp.h:44,
             from rtmp.cpp:42:
dh.h:22:24: error: openssl/bn.h: No such file or directory
dh.h:23:24: error: openssl/dh.h: No such file or directory
dh.h:25:25: error: openssl/sha.h: No such file or directory
dh.h:26:26: error: openssl/hmac.h: No such file or directory
dh.h:27:25: error: openssl/rc4.h: No such file or directory
In file included from rtmp.h:44,
                 from rtmp.cpp:42:
dh.h:34: error: 'BIGNUM' was not declared in this scope
dh.h:34: error: 'y' was not declared in this scope
dh.h:34: error: 'BIGNUM' was not declared in this scope
dh.h:34: error: 'p' was not declared in this scope
dh.h:34: error: 'BIGNUM' was not declared in this scope
dh.h:34: error: 'q' was not declared in this scope
dh.h:34: error: initializer expression list treated as compound expression
dh.h:35: error: expected constructor, destructor, or type conversion before '*' token
dh.h:36: error: 'DH' was not declared in this scope
dh.h:36: error: 'dh' was not declared in this scope
dh.h:37: error: 'DH' was not declared in this scope
dh.h:37: error: 'dh' was not declared in this scope
dh.h:37: error: expected primary-expression before '*' token
dh.h:37: error: 'pubkey' was not declared in this scope
dh.h:37: error: expected primary-expression before 'nPubkeyLen'
dh.h:37: error: initializer expression list treated as compound expression
dh.h:38: error: 'DH' was not declared in this scope
dh.h:38: error: 'dh' was not declared in this scope
dh.h:38: error: expected primary-expression before '*' token
dh.h:38: error: 'privkey' was not declared in this scope
dh.h:38: error: expected primary-expression before 'nPrivkeyLen'
dh.h:38: error: initializer expression list treated as compound expression
dh.h:39: error: 'DH' was not declared in this scope
dh.h:39: error: 'dh' was not declared in this scope
dh.h:39: error: expected primary-expression before '*' token
dh.h:39: error: 'pubkey' was not declared in this scope
dh.h:39: error: expected primary-expression before 'nPubkeyLen'
dh.h:39: error: expected primary-expression before '*' token
dh.h:39: error: 'secret' was not declared in this scope
dh.h:39: error: initializer expression list treated as compound expression
dh.h:40: error: variable or field 'DHFree' declared void
dh.h:40: error: 'DH' was not declared in this scope
dh.h:40: error: 'dh' was not declared in this scope
In file included from rtmp.cpp:42:
rtmp.h:97: error: ISO C++ forbids declaration of 'DH' with no type
rtmp.h:97: error: expected ';' before '*' token
rtmp.h:98: error: ISO C++ forbids declaration of 'RC4_KEY' with no type
rtmp.h:98: error: expected ';' before '*' token
rtmp.h:99: error: ISO C++ forbids declaration of 'RC4_KEY' with no type
rtmp.h:99: error: expected ';' before '*' token
rtmp.cpp: In member function 'int RTMP_LIB::CRTMP::ReadN(char*, int)':
rtmp.cpp:653: error: 'struct RTMP_LIB::LNK' has no member named 'rc4keyIn'
rtmp.cpp:654: error: 'struct RTMP_LIB::LNK' has no member named 'rc4keyIn'
rtmp.cpp:654: error: 'RC4' was not declared in this scope
rtmp.cpp: In member function 'bool RTMP_LIB::CRTMP::WriteN(const char*, int)':
rtmp.cpp:672: error: 'struct RTMP_LIB::LNK' has no member named 'rc4keyOut'
rtmp.cpp:674: error: 'struct RTMP_LIB::LNK' has no member named 'rc4keyOut'
rtmp.cpp:674: error: 'RC4' was not declared in this scope
make[1]: *** [rtmp.o] Error 1
make[1]: Leaving directory `/share/MD0_DATA/Qdownload/src'
make: *** [linux] Error 2
[/share/Qdownload/src] #

感谢您提供的任何建议。

【问题讨论】:

  • 这是否涉及“配置”步骤?看起来这些库不在编译器可以找到它们的地方,所以我敢打赌应该用路径指示它。检查自述文件如何实现这一点。
  • 啊,还有一件事。您是否检查过是否有可用的 openssl-devel 或 openssl-dev 软件包?您安装的很可能只是一个库。
  • 没有配置步骤,我没有open ssl的dev版本。我会调查的。

标签: linux compilation openssl arm rtmp


【解决方案1】:

确保安装 openssl 和 zlib 包的开发版本。

还要确保 openssl 目录位于标准系统中的某个位置,包括应该是 /usr/include/usr/local/include 的目录以及其他一些目录,具体取决于您的工具链。

但不要相信我的话并执行cpp -v &lt; /dev/null。它使用来自 /dev/null 的输入运行 GNU C 预处理器。应该打印目录搜索路径。查找“#include <...> 搜索从此处开始:”,然后是标准包含搜索路径的列表。这也是收录的顺序。

【讨论】:

  • 我没有这两个包的开发版本。不幸的是 ipkg 只能安装常规版本。我必须自己编译开发版本
  • 我有很多程序已经依赖于 openssl 如果我编译并安装 dev 版本我是否首先需要删除现有版本,是否可以在不破坏其他东西的情况下安装两个版本?
  • 不确定您使用的是哪个发行版,老实说,我从未处理过 ipkg。是松弛吗?在我的 Debian/Ubuntu 体验中,-dev 版本不会删除软件包,而是添加更多文件(包括、开发文档等),因此您可以正确包含/链接库。
  • 我错了,我已经能够使用 ipkg 来安装 openssl-dev 软件包,只是没有显示“ipkg list”。 IPKG 是 Optware 一个轻量级的包管理器。 Qnap nas 没有原生包管理器。会告诉你进展如何
【解决方案2】:

如果您正在为 ARM 进行编译,仅仅为您自己的发行版安装库是不够的……您需要库和一个在您的开发机器(可能是 x86 或 x86_64)上运行但为目标平台生成代码的交叉编译器(ARM)。

如果您没有此 Qnap NAS 的交叉编译器,this link 应该可以帮助您生成带有 crosstool-ng 的交叉编译器,这是一个帮助您从头开始构建交叉编译器的好工具。然后,您可能还需要一个根文件系统,其中包含为您的目标平台制作的库。

涉及交叉编译的所有事情都不是微不足道的,但我们可以尝试提供帮助。你在你的机器上运行什么发行版?

【讨论】:

  • 感谢您提供帮助。我没有尝试交叉编译,而是直接在 Qnap NAS 上编译。我安装了编译器和 Optware IPKG 包管理器,不幸的是我无法从 ipkg 获取 openssl-dev 包。我猜这可能比我预期的要困难得多。
  • 我不知道 ipkg,但取决于您的发行版,该软件包不称为“-dev”。你知道你使用的是哪个发行版吗? (Slackware 我确定不是……因为我每天都在使用它)
猜你喜欢
  • 2015-11-27
  • 1970-01-01
  • 1970-01-01
  • 2019-05-21
  • 2011-07-24
  • 2014-12-05
  • 2012-08-04
  • 1970-01-01
  • 2023-03-16
相关资源
最近更新 更多