使用arduino编译程序时出现程序里有调用这个库,但实际没有这个库

In file included from G:\Arduino\rp2040\sketch_jan14b\main.cpp:21:0:
C:\Users\Administrator\AppData\Local\Arduino15\packages\arduino\hardware\mbed_rp2040\4.1.1\cores\arduino/mbed/targets/TARGET_RASPBERRYPI/TARGET_RP2040/pico-sdk/common/pico_stdlib/include/pico/stdlib.h:11:10: fatal error: pico/stdio.h: No such file or directory
 #include "pico/stdio.h"
          ^~~~~~~~~~~~~~
compilation terminated.
exit status 1

Compilation error: exit status 1

这是调用出错的库

#ifndef _PICO_STDLIB_H
#define _PICO_STDLIB_H

#include "pico.h"
#include "pico/stdio.h"
#include "pico/time.h"
#include "hardware/gpio.h"
#include "hardware/uart.h

这是#include "pico/stdlib.h"这个库里面的,这个库是存在的,也有要调用#include "pico/stdio.h"这个库,但实际文件夹里没有这个库,还是在其他地方。

下面是一部份说明文档的解释

​
Aggregation of a core subset of Raspberry Pi Pico SDK libraries used by most executables along with some additional
 * utility methods. Including pico_stdlib gives you everything you need to get a basic program running
 * which prints to stdout or flashes a LED
 *
 * This library aggregates:
 *   - @ref hardware_uart
 *   - @ref hardware_gpio
 *   - @ref pico_binary_info
 *   - @ref pico_runtime
 *   - @ref pico_platform
 *   - @ref pico_printf
 *   - @ref pico_stdio
 *   - @ref pico_standard_link
 *   - @ref pico_util
 *
 * There are some basic default values used by these functions that will default to
 * usable values, however, they can be customised in a board definition header via
 * config.h or similar
 */

// Note PICO_STDIO_UART, PICO_STDIO_USB, PICO_STDIO_SEMIHOSTING are set by the
// respective INTERFACE libraries, so these defines are set if the library
// is included for the target executable

​

这段代码是关于Raspberry Pi Pico SDK库的一个子集聚合的描述。Pico SDK是Raspberry Pi RP2040微控制器的一个软件开发工具包,它提供了许多库和工具,使得开发者能够更容易地为这个微控制器编写代码。

以下是对代码的详细解释:

  1. 聚合库

    • 这段代码描述了一个聚合库,该库包含了大多数可执行文件所需的核心Pico SDK库子集以及一些额外的实用方法。使用pico_stdlib库,你可以获得运行一个基本程序所需的所有内容,比如向标准输出打印信息或闪烁LED。
  2. 包含的库

    • @ref hardware_uart: 硬件UART库,用于串行通信。
    • @ref hardware_gpio: 硬件GPIO库,用于通用输入输出。
    • @ref pico_binary_info: Pico二进制信息库,可能包含与二进制文件相关的信息。
    • @ref pico_runtime: Pico运行时库,提供程序运行时的支持。
    • @ref pico_platform: Pico平台库,与硬件平台相关的功能。
    • @ref pico_printf: Pico的printf实现,用于格式化输出。
    • @ref pico_stdio: Pico的标准输入输出库。
    • @ref pico_standard_link: 标准链接库,可能包含一些通用的链接器设置或函数。
    • @ref pico_util: Pico实用工具库,包含一些实用的函数或方法。
  3. 默认值

    • 这些函数使用了一些基本的默认值,这些默认值通常是可以使用的。但是,如果你需要,可以在板级定义头文件中通过config.h或类似的文件来定制这些值。
  4. 接口库设置

    • PICO_STDIO_UARTPICO_STDIO_USBPICO_STDIO_SEMIHOSTING 这些定义是由各自的接口库设置的。如果目标可执行文件包含了相应的库,那么这些定义就会被设置。这意味着,这些定义用于确定程序应该使用哪种接口进行标准输入/输出,例如UART、USB还是半托管模式。

总的来说,这段代码描述了一个为Raspberry Pi RP2040微控制器提供的Pico SDK库的子集聚合,这个子集包含了大多数基本程序所需的功能,并允许开发者根据需要定制一些默认值。

  • 11
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

星海露水

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值