“没有这样的文件或目录”,但文件和目录已包含 - 基于 Eclipse 的 IDE - c 项目

问题描述 投票:0回答:2

我在尝试在 STM32CubeIDE 中编译 Semtech SDK 时遇到问题。我正在研究如何在该 IDE 中编译和调试它,因为这些项目是仅为 Keil uVision 创建的,并且是使用 GNU ARM 工具链作为 Makefiles 创建的。

我有以下错误“没有这样的文件或目录”,但该目录已包含。

17:29:44 **** Incremental Build of configuration Debug for project gnss_test_executable_02 ****
make all 
arm-none-eabi-gcc "../lr11xx/common/printers/lr11xx_bootloader_types_str.c" -mcpu=cortex-m4 -std=gnu11 -g3 -c -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"lr11xx/common/printers/lr11xx_bootloader_types_str.d" -MT"lr11xx/common/printers/lr11xx_bootloader_types_str.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "lr11xx/common/printers/lr11xx_bootloader_types_str.o"
In file included from ../lr11xx/common/printers/lr11xx_bootloader_types_str.c:1:
../lr11xx/common/printers/lr11xx_bootloader_types_str.h:3:10: fatal error: lr11xx_bootloader_types.h: No such file or directory
    3 | #include "lr11xx_bootloader_types.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [lr11xx/common/printers/subdir.mk:40: lr11xx/common/printers/lr11xx_bootloader_types_str.o] Error 1
"make all" terminated with exit code 2. Build might be incomplete.

17:29:48 Build Failed. 2 errors, 0 warnings. (took 3s.298ms)

我已将SDK的文件目录导入到我的工作空间中。

我包含了所有具有.h文件的文件夹,包括错误文件所在的“lr11xx\lr11xx_driver\src”。

这可能是与宏或环境变量相关的问题吗?

提前致谢,请随时询问您可能需要的任何信息。

我尝试过的:

我已在“C/C++ Build”部分的属性中包含“Includes”目录。

我还特别在 C/C++ Build -> Settings -> Tool Settings -> MCU GCC Compiler -> Include Paths -> Include files (-include) 部分中包含了文件“lr11xx_bootloader_types.h”。

我试图弄清楚这是否与宏或环境变量有关,但尚未找到解决方案。

c eclipse build ide
2个回答
0
投票

您需要添加

.h
文件所在的路径。

它位于项目属性->C/C++常规->路径和符号中的包含选项卡。


0
投票

我对 2023 09 Eclipse 也有同样的问题。 原因是 gcc 发生在指定构建目录的子目录中,例如“Debug”。

如果我转到包含声明并更改为: 文件夹/header.h 到 ../文件夹/标题.h

但是重构所有源文件中包含的每个标头并不可取。 必须有一个复选框来解决此问题,但似乎没有人知道。

© www.soinside.com 2019 - 2024. All rights reserved.