【问题标题】:How to make librtmp compile on Mac OS X如何在 Mac OS X 上编译 librtmp
【发布时间】:2016-03-13 02:21:57
【问题描述】:

我正在尝试在 mac 上构建 rtmpdump 和 librtmp,但是我终其一生都无法弄清楚它为什么不起作用。我正在使用自己构建的 openssl:

$ openssl version
OpenSSL 1.1.0-pre3 (alpha) 15 Feb 2016

我已经正确设置了标志(我认为),但是当我尝试编译时,我得到了这个:

$ make INC=-I/usr/local/include
gcc -Wall  -I/usr/local/include -DRTMPDUMP_VERSION=\"v2.4\" -DUSE_OPENSSL  -O2 -fPIC   -c -o rtmp.o rtmp.c
In file included from rtmp.c:152:
./handshake.h:120:12: error: variable has incomplete type 'HMAC_CTX' (aka 'struct hmac_ctx_st')
  HMAC_CTX ctx;
           ^
/usr/local/include/openssl/ossl_typ.h:145:16: note: forward declaration of 'struct hmac_ctx_st'
typedef struct hmac_ctx_st HMAC_CTX;
               ^
In file included from rtmp.c:152:
./handshake.h:125:3: warning: implicit declaration of function 'HMAC_CTX_init' is invalid in C99 [-Wimplicit-function-declaration]
  HMAC_setup(ctx, secretKey, 128);
  ^
./handshake.h:72:35: note: expanded from macro 'HMAC_setup'
#define HMAC_setup(ctx, key, len)       HMAC_CTX_init(&ctx); HMAC_Init_ex(&ctx, key, len, EVP_sha256(), 0)
                                        ^
./handshake.h:127:3: warning: implicit declaration of function 'HMAC_CTX_cleanup' is invalid in C99 [-Wimplicit-function-declaration]
  HMAC_finish(ctx, digest, digestLen);
  ^
./handshake.h:74:67: note: expanded from macro 'HMAC_finish'
#define HMAC_finish(ctx, dig, dlen)     HMAC_Final(&ctx, dig, &dlen); HMAC_CTX_cleanup(&ctx)
                                                                      ^
./handshake.h:269:12: error: variable has incomplete type 'HMAC_CTX' (aka 'struct hmac_ctx_st')
  HMAC_CTX ctx;
           ^
/usr/local/include/openssl/ossl_typ.h:145:16: note: forward declaration of 'struct hmac_ctx_st'
typedef struct hmac_ctx_st HMAC_CTX;
               ^
rtmp.c:192:13: warning: comparison of constant 18446744073709551597 with expression of type 'uint32_t' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare]
  if (nSize > SIZE_MAX - RTMP_MAX_HEADER_SIZE)
      ~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings and 2 errors generated.
make[1]: *** [rtmp.o] Error 1
make: *** [librtmp/librtmp.a] Error 2

看起来这可能是我使用的 OpenSSL 版本的兼容性问题。有谁知道如何解决此类问题,或者对 OpenSSL 进行任何可能负责的更改?

【问题讨论】:

    标签: macos compilation compiler-errors openssl osx-elcapitan


    【解决方案1】:

    OpenSSL 1.1.0-pre3(alpha)2016 年 2 月 15 日...

    有谁知道如何解决此类问题,或者对 OpenSSL 进行任何可能负责的更改?

    一般而言,OpenSSL 1.1.x 中似乎有两个高级别的变化导致了大​​部分问题。首先是构建系统的变化。其次是对私有 API 的更坚定立场。我认为您看到的是第二个工件,即私有 API。

    一般来说,1.1.0-pre3 和 1.1.0-pre4 存在很多问题,大多无法成功实现make test。这些问题包括 32 位 OS X PowerMac、64 位 OS X PowerMac、32 位 OS X、64-bit OS X32-bit ARM strike>、64 位 ARM、 OpenBSD 5.7、NetBSD 7.0、Cygwin、CentOS 5、CentOS 7 和 i686。如此之多,以至于我已经提交了大约 25 个错误,为即将于 2016 年 3 月 14 日星期一到达的即将到来的 Beta-1 做准备。

    你现在应该避免1.1.0-pre-N,因为它太不稳定了。在 x86_64 Linux 下你应该没问题,但目前其他任何事情都是废话。你应该可以在 Beta-2 左右再次拿起它。

    在 2016 年 3 月 11 日星期五提交之后,您可能会获得更好的 Master 提示。这将大致是提交 0d4d5ab 和 4c1cf7e。您可以通过以下方式获取最新信息:

    git clone git://git.openssl.org/openssl.git
    

    或者,使用 1.0.2 稳定版本。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-21
      • 2012-09-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多