/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 13:23:08 浏览: 14
这是一个编译错误,错误信息显示 'oss' 变量没有在作用域内声明。同时,第二个错误信息提示没有找到匹配的 'put_time' 函数。这可能是因为没有包含正确的头文件或者使用了错误的参数类型导致的。你可以检查代码中是否正确地声明了 'oss' 变量,并且确认是否包含了正确的头文件。同时,'put_time' 函数需要一个时间结构体作为第一个参数,你需要确保传递了正确的参数类型。
相关问题
/opt/pkg/petalinux/2019.1/components/yocto/source/aarch64/layers/core/meta/recipes-sato/webkit/webkitgtk_2.20.5.bb:do_compile原因
根据提供的引用内容,`/opt/pkg/petalinux/2019.1/components/yocto/source/aarch64/layers/core/meta/recipes-sato/webkit/webkitgtk_2.20.5.bb:do_compile` 是一个位于 `webkitgtk_2.20.5.bb` 文件中的 `do_compile` 函数。这个函数的作用是编译 `webkitgtk` 软件包。
具体来说,`do_compile` 函数是 Yocto Project 中的一个任务函数,用于在构建过程中编译软件包。在 `webkitgtk_2.20.5.bb` 文件中,`do_compile` 函数定义了编译 `webkitgtk` 软件包所需的步骤和命令。
由于没有提供具体的 `do_compile` 函数的内容,无法给出更详细的解释。但一般来说,`do_compile` 函数会执行一系列编译命令,例如配置编译环境、生成编译选项、编译源代码等。这些命令的目的是将源代码转换为可执行的二进制文件或库文件。
如果你想了解更多关于 `do_compile` 函数的详细信息,建议查看 `webkitgtk_2.20.5.bb` 文件中的具体实现。
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 文件,查看更多详细信息以确定错误原因并进行修复。