为什么我会在git subsodule上获得标题包含错误

发布于 2025-02-12 09:34:46 字数 739 浏览 2 评论 0原文

我已经服用了另一个 library ,并将其作为子模块添加到我的存储库中。 我包括这样的图书馆。

#include "../NMEA2000/src/NMEA2000_CAN.h"

我使用QMAKE生成的makefile进行编译。标题文件及其包含在.pro文件中也引用了。 我仍然会遇到以下错误:

In file included from ../NMEA2000/src/NMEA2000.h:50:0,
             from ../NMEA2000/src/NMEA2000_CAN.h:89,
             from MainWindow.cpp:15:
../NMEA2000/src/N2kCANMsg.h:26:10: fatal error: N2kMsg.h: file or directory not found
 #include <N2kMsg.h>

显然我包含的文件,而下一个文件也没有,但没有包含的文件。如果我将所讨论的文件更改为#include“ n2kmsg.h”而不是。我将遇到一个有类似问题的下一个,但指向另一个子模块。 我有一种强烈的感觉,我缺少有关标题的工作方式。我在这里做错了什么?我希望不触摸子模块的内容。

I have taken another ones library and added it as a submodule to my repository.
I included the library like this.

#include "../NMEA2000/src/NMEA2000_CAN.h"

I compile using a qmake generated makefile. The header file and its includes are referred to in the .pro file as well.
I still get the following error:

In file included from ../NMEA2000/src/NMEA2000.h:50:0,
             from ../NMEA2000/src/NMEA2000_CAN.h:89,
             from MainWindow.cpp:15:
../NMEA2000/src/N2kCANMsg.h:26:10: fatal error: N2kMsg.h: file or directory not found
 #include <N2kMsg.h>

Apparently the file I included and the next one are being found but not another that is included there. If I change the file in question to #include "N2kMsg.h" instead. I will just run into the next one with a similar issue but pointing to another submodule.
I have a strong feeling that I am missing something about the way headers work. What am I doing wrong here? I would prefer not to touch the contents of the submodule.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文