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:
- ifneq "$(ALLOW_WARNINGS)" "1"
- CFLAGS += -Werror
- ifeq ("$(OSTYPE)","Darwin")
- CFLAGS += -Wno-deprecated-declarations -Wno-unused-private-field -Wno-unused-const-variable
- endif
- endif
Then save the file and get out
use command 'make' to compile
Reference: