/home/petalinux/HesaiLidar_General_SDK/test/test.cc:52:4: error: 'oss' was not declared in this scope 52 | oss << std::put_time(timestamp, "%Y-%m-%d %H:%M:%S.") << std::setfill('0') << std::setw(3) << static_cast<int>((timestamp - std::floor(timestamp)) * 1000) << std::setfill('0') << std::setw(3) << static_cast<int>((timestamp - std::floor(timestamp)) * 1000000) % 1000; | ^~~ /home/petalinux/HesaiLidar_General_SDK/test/test.cc:52:56: error: no matching function for call to 'put_time(double&, const char [19])' 52 | oss << std::put_time(timestamp, "%Y-%m-%d %H:%M:%S.") << std::setfill('0') << std::setw(3) << static_cast<int>((timestamp - std::floor(timestamp)) * 1000) << std::setfill('0') << std::setw(3) << static_cast<int>((timestamp - std::floor(timestamp)) * 1000000) % 1000; | ^
时间: 2024-04-27 22:23:08 浏览: 143
这是一个编译错误,错误信息显示 'oss' 变量没有在作用域内声明。同时,第二个错误信息提示没有找到匹配的 'put_time' 函数。这可能是因为没有包含正确的头文件或者使用了错误的参数类型导致的。你可以检查代码中是否正确地声明了 'oss' 变量,并且确认是否包含了正确的头文件。同时,'put_time' 函数需要一个时间结构体作为第一个参数,你需要确保传递了正确的参数类型。
相关问题
WARNING: /home/xyc/work/petalinux_prj/20230518/zynq_petalinux/build/tmp/work/zynqmp_generic-xilinx-linux/linux-xlnx/5.10+git999-r0/temp/run.do_kernel_configme.126308:414 exit 1 from 'exit 1' WARNING: Backtrace (BB generated script): #1: bbfatal, /home/xyc/work/petalinux_prj/20230518/zynq_petalinux/build/tmp/work/zynqmp_generic-xilinx-linux/linux-xlnx/5.10+git999-r0/temp/run.do_kernel_configme.126308, line 414 #2: do_kernel_metadata, /home/xyc/work/petalinux_prj/20230518/zynq_petalinux/build/tmp/work/zynqmp_generic-xilinx-linux/linux-xlnx/5.10+git999-r0/temp/run.do_kernel_configme.126308, line 251 #3: do_kernel_configme, /home/xyc/work/petalinux_prj/20230518/zynq_petalinux/build/tmp/work/zynqmp_generic-xilinx-linux/linux-xlnx/5.10+git999-r0/temp/run.do_kernel_configme.126308, line 152 #4: main, /home/xyc/work/petalinux_prj/20230518/zynq_petalinux/build/tmp/work/zynqmp_generic-xilinx-linux/linux-xlnx/5.10+git999-r0/temp/run.do_kernel_configme.126308, line 459 Backtrace (metadata-relative locations): #1: bbfatal, /home/xyc/work/petalinux_prj/20230518/zynq_petalinux/components/yocto/layers/core/meta/classes/logging.bbclass, line 60 #2: do_kernel_metadata, /home/xyc/work/petalinux_prj/20230518/zynq_petalinux/components/yocto/layers/core/meta/classes/kernel-yocto.bbclass, line 159 #3: do_kernel_configme, /home/xyc/work/petalinux_prj/20230518/zynq_petalinux/components/yocto/layers/core/meta/classes/kernel-yocto.bbclass, line 395 ERROR: Logfile of failure stored in: /home/xyc/work/petalinux_prj/20230518/zynq_petalinux/build/tmp/work/zynqmp_generic-xilinx-linux/linux-xlnx/5.10+git999-r0/temp/log.do_kernel_configme.126308 NOTE: recipe linux-xlnx-5.10+git999-r0: task do_kernel_configme: Failed ERROR: Task (/home/xyc/work/petalinux_prj/20230518/zynq_petalinux/components/yocto/layers/meta-xilinx/meta-xilinx-bsp/recipes-kernel/linux/linux-xlnx_2021.1.bb:do_kernel_configme) failed with exit code '1' NOTE: recipe libgcc-initial-10.2.0-r0: task do_configure: Succeeded NOTE: Tasks Summary: Attempted 545 tasks of which 0 didn't need to be rerun and 1 failed. ERROR: bitbake failed to configure u-boot ERROR: Failed to config u-boot. Check the /home/xyc/work/petalinux_prj/20230518/zynq_petalinux/build/config.log file for more details...
这段错误信息是在进行 Petalinux 项目编译时出现的。其中关键信息是 "Failed to config u-boot",可能是由于配置 u-boot 时出现了错误导致编译失败。建议检查 /home/xyc/work/petalinux_prj/20230518/zynq_petalinux/build/config.log 文件,查看更多详细信息以确定错误原因并进行修复。
Can't locate FindBin.pm in @INC (you may need to install the FindBin module) (@INC contains: /home/yk/sdk/sysroots/x86_64-petalinux-linux//usr/lib/perl/site_perl/5.24.4 /home/yk/sdk/sysroots/x86_64-petalinux-linux//usr/lib/perl/vendor_perl/5.24.4 /home/yk/sdk/sysroots/x86_64-petalinux-linux//usr/lib/perl/5.24.4 /opt/petalinux/2019.1/sysroots/x86_64-petalinux-linux/usr/lib/perl/site_perl/5.24.4/ /opt/petalinux/2019.1/sysroots/x86_64-petalinux-linux/usr/lib/perl/site_perl/5.24.4 /opt/petalinux/2019.1/sysroots/x86_64-petalinux-linux/usr/lib/perl/vendor_perl/5.24.4/ /opt/petalinux/2019.1/sysroots/x86_64-petalinux-linux/usr/lib/perl/vendor_perl/5.24.4 /opt/petalinux/2019.1/sysroots/x86_64-petalinux-linux/usr/lib/perl/5.24.4/ /opt/petalinux/2019.1/sysroots/x86_64-petalinux-linux/usr/lib/perl/5.24.4 /opt/petalinux/2019.1/sysroots/x86_64-petalinux-linux/usr/lib/perl/5.24.4 .) at ./Configure line 15. BEGIN failed--compilation aborted at ./Configure line 15
这个错误提示表明你的Perl运行环境中缺少FindBin模块,而你的代码中使用了该模块。你需要安装FindBin模块,可以使用以下命令:
```
cpan FindBin
```
如果你没有安装CPAN,可以使用以下命令安装:
```
sudo apt-get install cpanminus
```
安装完成后,再执行上面的命令即可安装FindBin模块。
阅读全文