##在Docker中编译报错-20230601
include/generated/nvtversion.h:1:1: error: expected identifier or '(' before '-' token
include/generated/nvtversion.h:1:4: error: stray '#' in program
make[1]: *** [sub-make] Error 2
linux: Build finish
In file included from ../arch/mips/nvt-boards/na51023/nvt-info.c:22:0:
include/generated/nvtversion.h:1:1: error: expected identifier or '(' before '-' token
-e #define NVT_UTS_RELEASE "4.1.0_e46cb0d"
^
include/generated/nvtversion.h:1:4: error: stray '#' in program
-e #define NVT_UTS_RELEASE "4.1.0_e46cb0d"
^
../arch/mips/nvt-boards/na51023/nvt-info.c: In function 'nvt_version_show':
../arch/mips/nvt-boards/na51023/nvt-info.c:299:34: error: 'NVT_UTS_RELEASE' undeclared (first use in this function)
seq_printf(m, "Version: %s \n", NVT_UTS_RELEASE);
^
../arch/mips/nvt-boards/na51023/nvt-info.c:299:34: note: each undeclared identifier is reported only once for each function it appears in
make[4]: *** [arch/mips/nvt-boards/na51023/nvt-info.o] Error 1
make[3]: *** [arch/mips/nvt-boards/na51023] Error 2
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [arch/mips] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [sub-make] Error 2
make: *** [linux] Error 2
可以初步判断问题出现在Docker容器中的编译过程中。可能的原因包括:
NVT SDK 6.7x 版本与当前Docker容器中的编译器版本不兼容;
Docker容器中的编译环境缺失了必要的依赖项或配置错误;
NVT SDK源代码中存在错误或语法问题。
学习路径为B站狂神老师。