在附加标头包含路径中包含标头

发布于 2025-01-07 17:55:32 字数 1408 浏览 4 评论 0原文

我在 windows 7 32 位上使用 eclipse Indigo for windows 和基于 ARM 交叉编译工具链的工具链,其版本为 glibc-2.9 gcc-4.3.4。我的项目目前使用 C 语言,但如果有必要,我愿意随时将其更改为 C++;您可能想了解的其配置如下。

在项目属性的“C/C++ build->settings”部分中,我给出了路径“/cygdrive/c/glibc-oabi-toolchain-arm-generic/bin/arm-unknown -linux-gnu-gcc”,用于“GCC C 编译器”和“GCC C 链接器”和“GCC 汇编器”他们的命令框并为编译器和链接器设置一些杂项参数。然后在“C/C++ build->Tool Chain Editor”部分中,将“当前构建器”设置为“Gnu Make Builder”并且“当前工具链”设置为“Linux GCC”。

现在的问题是我似乎无法正确设置其他包含路径,因为尽管我在“C/C++”中添加了类似“c:\sdk\include”的路径build->settings->GCC C Compiler->Includes”部分,并且该路径中有一个类似“stdio.h”的标头,我在

unresolved inclusion:<stdio.h>

以下代码行

中遇到以下错误#include;

最后,如果可能有任何帮助,我为编译器设置的其他参数是“-Wundef -Wstrict-prototypes -Werror-implicit-function-declaration -Wdeclaration-after-语句-fsigned-char -marm -mapcs -march=armv5te -mtune=arm9tdmi -mno-sched-prolog -mabi=apcs-gnu -mlittle-endian -mno-thumb-interwork -msoft-float -c”,链接器为“-marm -mapcs -march=armv5te -mtune=arm9tdmi -mno- sched-prolog -mabi=apcs-gnu -mlittle-endian -mno-thumb-interwork -msoft-float -Wl,-Map,"${PWD}/${ProjName}.map"。

如有任何有关问题原因的建议,我们将不胜感激,谢谢。

I'm using eclipse Indigo for windows on windows 7 32-bit and a toolchain based on ARM cross compile toolchain which has the version of glibc-2.9 gcc-4.3.4. My project is currently in C but I'm willing to change it to C++ anytime if necessary; its configurations you might want to know are as follows.

In "C/C++ build->settings" section in project properties I gave the path "/cygdrive/c/glibc-oabi-toolchain-arm-generic/bin/arm-unknown-linux-gnu-gcc" for "GCC C Compiler" and "GCC C Linker" and "GCC Assembler" in their command boxes and set some miscellaneous parameters for compiler and linker. Then in the "C/C++ build->Tool Chain Editor" section the "Current builder" is set to "Gnu Make Builder" and the "Current toolchain" is set to "Linux GCC".

Now the issue is I don't seem to be able to set additional include paths properly since although I've added a path like "c:\sdk\include" in "C/C++ build->settings->GCC C Compiler->Includes" section and there's a header like "stdio.h" in that path I encounter the following error

unresolved inclusion:<stdio.h>

for following line of code

#include <stdio.h>;

Finally if it might be of any help the miscellaneous parameters I set for compiler are "-Wundef -Wstrict-prototypes -Werror-implicit-function-declaration -Wdeclaration-after-statement -fsigned-char -marm -mapcs -march=armv5te -mtune=arm9tdmi -mno-sched-prolog -mabi=apcs-gnu -mlittle-endian -mno-thumb-interwork -msoft-float -c" and for linker are "-marm -mapcs -march=armv5te -mtune=arm9tdmi -mno-sched-prolog -mabi=apcs-gnu -mlittle-endian -mno-thumb-interwork -msoft-float -Wl,-Map,"${PWD}/${ProjName}.map".

Any advise on what might be the cause of problem is appreciated, thanks.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

黯然 2025-01-14 17:55:32

您需要告诉 Eclipse 您的编译器的包含目录在哪里。我认为您应该这样做:

项目菜单中,选择属性。在C/C++常规>下路径和符号>包括,单击添加...按钮。输入编译器包含目录的完整路径(带有 stdio.h 的目录)。选中“添加到所有语言”框并单击“确定”。这将允许 Eclipse 找到编译器提供的标头,例如 stdio.h,这将减少您看到的警告数量。

You need to tell Eclipse where the include directory of your compiler is. I think this is how you do it:

In the Project menu, select Properties. Under C/C++ General > Paths and Symbols > Includes, click the Add… button. Enter the full path to your compiler's include directory (the one with stdio.h). Check the "Add to all languages" box and click OK. This will allow Eclipse to find the headers provided by the compiler, such as stdio.h, which will reduce the number of warnings you see.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文