linux下编译live555

    在live555的官网上已经有linux下编译的说明,如下:

How to configure and build the code on Unix (including Linux, Mac OS X, QNX, and other Posix-compliant systems)

The source code package can be found (as a ".tar.gz" file) here. Use "tar -x" and "gunzip" (or "tar -xz", if available) to extract the package; then cd to the "live" directory. Then run

    ./genMakefiles <os-platform>

where <os-platform> is your target platform - e.g., "linux" or "solaris" - defined by a "config.<os-platform>" file. This will generate a Makefile in the "live" directory and each subdirectory. Then run "make".

  • If the "make" fails, you may need to make small modifications to the appropriate "config.<os-platform>" file, and then re-run "genMakefiles <os-platform>". (E.g., you may need to add another "-I<dir>" flag to the COMPILE_OPTS definition.)
  • Some people (in particular, FreeBSD users) have reported that the GNU version of "make" - often called "gmake" - works better than their default, pre-installed version of "make". (In particular, you should try using "gmake" if you encounter linking problems with the "ar" command.)
  • If you're using "gcc" version 3.0 or greater: You may also wish to add the -Wno-deprecated flag to CPLUSPLUS_FLAGS.
  • If no "config.<os-platform>" file exists for your target platform, then try using one of the existing files as a template.

If you wish, you can also 'install' the headers, libraries, and applications by running "make install".

现在按如下步骤编译:

1从live555官网上下载源码,执行tar -zxvf live.2011.06.14a.tar.gz,解压到linux目录下。

2到live555目录下,发现有很多类似config.xx-xx的文件名,这是针对不同平台的配置文件。执行./genMakefiles linux-gdb。

3执行make。到此编译完成,在4个子目录下可以找到生成的.a文件。

遇到的问题:

1》执行make时提示:“#include <xlocale.h> // because, on some systems, <locale.h> doesn't include <xlocale.h>; this makes sure that we get both”

找到locale.h文件,发现一段提示为:

// If you're on a system that (for whatever reason) doesn't have either the "setlocale()" or the "newlocale()" function, then

// add "-DLOCALE_NOT_USED" to your "config.*" file.

// If you're on a system that (for whatever reason) has "setlocale()" but not "newlocale()", then

// add "-DXLOCALE_NOT_USED" to your "config.*" file.

// (Note that -DLOCALE_NOT_USED implies -DXLOCALE_NOT_USED; you do not need both.)

// Also, for Windows systems, we define "XLOCALE_NOT_USED" by default, because at least some Windows systems

// (or their development environments) don't have "newlocale()".  If, however, your Windows system *does* have "newlocale()",

// then you can override this by defining "XLOCALE_USED" before #including this file.

这个文字的意思是:windows下默认使用XLOCALE_NOT_USED宏,也就是系统有“setlocale()”,无“newlocale()”,我也按照类似的定义,打开“config.linux-gdb”文件,在CPLUSPLUS_FLAGS后加上-DXLOCALE_NOT_USED,保存,再执行make,编译通过。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

山西茄子

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值