将头文件添加到 LPCXPsPresso 时出现'app_usbd_cfg.h: No such file or directory'错误

'app_usbd_cfg.h: No such file or directory' error when adding header files to lpcxpresso

本文关键字:No cfg such file 错误 directory or usbd LPCXPsPresso 添加 app      更新时间:2023-10-16

我正试图在LPCOPEN示例项目的基础上,用lpc11u68 MCU为USB HID应用程序创建一个新项目。

问题是,编译器无法识别其他文件夹上的头文件。它显示了这个

error:../Main/src/Main.cpp:12:26: fatal error: app_usbd_cfg.h: No such file or directory

我已经完全完成了本教程中的所有说明,但问题仍然存在。当我将所有标头和源代码复制到项目的主目录时,它编译正确!

我使用快速设置->include路径将我的头的路径引入Xpresso。这就像上面教程中描述的指令一样,但只适用于C项目!

当您在C++项目中使用该快捷方式时,它会将路径添加到C编译器Includes而不是C++!多么有趣的虫子!