0

我正在尝试为 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] #

感谢您提供的任何建议。

4

2 回答 2

1

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

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

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

于 2012-06-26T16:13:10.727 回答
0

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

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

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

于 2012-06-26T19:57:24.383 回答