Eclipse CDT中找不到标题文件 [英] Header file not found in Eclipse CDT

查看:122
本文介绍了Eclipse CDT中找不到标题文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Eclipse CDT 8.8.1构建一个使用外部库(Casablanca)的项目。在Mac OS上。如预期的那样,第一个构建运行返回cpprest / http_client.h文件未找到错误。

I'm trying to build a project that uses an external library (Casablanca) using Eclipse CDT 8.8.1. on Mac OS. As expected, the first build run returned "cpprest/http_client.h file not found" errors.

然后,右键单击项目,然后选择属性 - > C,然后继续添加包含路径(/ Users / me / projects / casablanca / Release / include) / C ++包含路径和符号,添加外部包含路径,并将其作为第一个列出的文件夹优先移动。

I then proceeded to add an include path (/Users/me/projects/casablanca/Release/include) by right-clicking on the project, selecting Properties->C/C++ Include Paths and Symbols, Add External Include Path, and moving it up in priority as the first listed folder.

但是这并没有解决问题,Eclipse仍然可以似乎找不到标题。 #include指令如下:

However this did not solve the problem and Eclipse still can't seem to find the headers. The #include directive is as below:

#include <cpprest/http_client.h>

,添加的/ include目录有一个/ cpprest子目录,其中有http_client.h

and the added /include directory does have a /cpprest sub-directory, with http_client.h in it.

任何帮助将不胜感激。

推荐答案

路径到项目属性| C / C ++一般|路径和符号仅将包含路径添加到CDT的索引器在索引项目时搜索的包含的集合。

Adding an include path to Project Properties | C/C++ General | Paths and Symbols only adds the include path to the set of includes searched by CDT's indexer when indexing the project.

实际构建系统需要通过另一种手段告诉包容性路径。如果您正在使用托管构建项目(而不是Makefile项目) - 这听起来像您是 - 您将添加包含路径在项目属性| C / C ++ Build |设置。请注意,索引器会自动获取构建设置,因此一旦执行此操作,就不必将其添加到路径和符号中。

The actual build system needs to be told the include path by another means. If you're using a Managed Build project (as opposed to a Makefile project) - which it sounds like you are - you would add the include path in Project Properties | C/C++ Build | Settings. Note that the indexer automatically picks up build settings, so once you do this, there shouldn't be a need to also add it to Paths and Symbols.

这篇关于Eclipse CDT中找不到标题文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆