Resolve “liveMedia/include/Locale.hh:47:10: fatal error: xlocale.h: No such file or directory”

1. Question

        When I use Ubuntu18.04 desktop operating system to compile "Onenet Video SDK"(https://github.com/cm-heclouds/video_sdk),I encountered an problem as below:

[ 34%] Building CXX object sample/live/CMakeFiles/livertsp_s.dir/liveMedia/Locale.cpp.o
In file included from /home/yulong/onenet_VIDEO/video_sdk/sample/live/liveMedia/Locale.cpp:22:0:
/home/yulong/onenet_VIDEO/video_sdk/sample/live/liveMedia/include/Locale.hh:47:10: fatal error: xlocale.h: No such file or directory
 #include <xlocale.h> // because, on some systems, <locale.h> doesn't include <xlocale.h>; this makes sure that we get both
          ^~~~~~~~~~~
compilation terminated.
sample/live/CMakeFiles/livertsp_s.dir/build.make:1718: recipe for target 'sample/live/CMakeFiles/livertsp_s.dir/liveMedia/Locale.cpp.o' failed
make[2]: *** [sample/live/CMakeFiles/livertsp_s.dir/liveMedia/Locale.cpp.o] Error 1
CMakeFiles/Makefile2:335: recipe for target 'sample/live/CMakeFiles/livertsp_s.dir/all' failed
make[1]: *** [sample/live/CMakeFiles/livertsp_s.dir/all] Error 2 

 

2. Analysis:

        We can open /home/yulong/onenet_VIDEO/video_sdk/sample/live/liveMedia/include/Locale.hh, from line 47 we can see below:

        So it is apparently the trouble is because in our system there is neither locale.h nor xlocale.h.

 

3. Resolution 

         We can add "-DLOCALE_NOT_USED" to compile options.  If we use CMake tool to help compile, we can just add an "-DXLOCALE_NOT_USED" to definitions:
add_definitions(-DXLOCALE_NOT_USED)
        Job done. 

 

 4.  Summarize knowledge

      locale.h is a C programming standard library header file, it proclaim the C language localization functions which usually help multi-language software programming design.

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值