ubuntu-20.04 Astra-pro configuration

In function ‘char* strncpy(char*, const char*, size_t)’,
    inlined from ‘Agent::queryLocalData(std::string&, ResponseDataT&)’ at ./Agent/Agent.cc:715:14:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:34: error: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ specified bound 255 equals destination size [-Werror=stringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

for the above error message:

we should open floder : OpenNI-Linux-x64-x.x.xx(version number)

then open file : Samples/SimpleViewer/CommonCppMakefile

Delete lines 74-76

The delete contents are as follows:

  1. ifneq "$(ALLOW_WARNINGS)" "1"
  2.     CFLAGS += -Werror
  3. ifeq ("$(OSTYPE)","Darwin")
  4.     CFLAGS += -Wno-deprecated-declarations -Wno-unused-private-field -Wno-unused-const-variable
  5. endif
  6. endif

Then save the file and get out

use command 'make' to compile

Reference:

  1. GCC 9.4 编译 specified bound 255 equals destination size [-Werror=stringop-truncation]_lm_hao的博客-CSDN博客前提最近项目需要使用最新的 Ubuntu 20.4,查看下 编译器版本居然是 9.4.0,自然项目迁移过程中会有很多编译问题需要解决,毕竟之前的 gcc 版本都是 4.8.5的,差距很大。环境lm@lm:~$ uname -aLinux leimin 5.4.0-107-generic #121-Ubuntu SMP Thu Mar 24 16:04:27 UTC 2022 x86_64 x86_64 x86_64 GNU/Linuxlm@lm:~$ gcc -vUsing built-inhttps://blog.csdn.net/llm_hao/article/details/124279032?spm=1001.2101.3001.6661.1&utm_medium=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1-124279032-blog-113791634.pc_relevant_multi_platform_whitelistv1&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1-124279032-blog-113791634.pc_relevant_multi_platform_whitelistv1

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值