Eclipse CDT:未解析包含stl头 [英] Eclipse CDT: Unresolved inclusion of stl header
问题描述
我试图使用Eclipse编辑源代码,在C ++ Builder下编译,但是仍然遇到未解决的包含
问题。
例如,代码如下:
#include< vector&
给予未解决的包含:< vector>
Eclipse IDE中的错误。 C ++ Builder确实没有向量
文件,而是有编译器使用的 vector.h
。
如果我写
#include< vector.h> ;
如何告诉Eclipse使用 vector.h
当它看到 #include< vector>
?
这使我避免Eclipse未解决的包含错误。
在我的情况下,我不得不找到我的电脑上的C ++向量标题的位置(这是一个Mac) :
find / usr / local -name vector -print
我在文件夹/usr/include/c++/4.2.1中找到了正确的包含位置。然后我设置我的项目eclipse设置像这样:
Project->属性 - > C / C ++ General->和Symbols-> GNU C ++ - >(Add) - >/ usr / include / c ++ / 4.2.1
我没有使用C ++ Builder,但我的解决方案可能解决了部分麻烦。
I'm trying to use Eclipse to edit sources, compiled under C++ Builder, but stuck with Unresolved inclusion
problem.
For example, code like:
#include <vector>
Gives Unresolved inclusion: <vector>
error in Eclipse IDE. C++ Builder indeed has no vector
file, instead it has vector.h
which is used by compiler.
Eclipse IDE gives no error if I write
#include <vector.h>
How do I tell Eclipse to use vector.h
when it sees #include <vector>
?
This allowed me to avoid Eclipse "Unresolved inclusion" error.
In my case I had to find the location of the C++ vector header on my computer (which is a Mac):
find /usr/local -name vector -print
I found the correct include location in folder "/usr/include/c++/4.2.1". Then I set my project eclipse settings like so:
Project->Properties->C/C++ General->Paths and Symbols->GNU C++->(Add)->"/usr/include/c++/4.2.1"
I'm not using C++ Builder, but my solution might address part of your trouble.
这篇关于Eclipse CDT:未解析包含stl头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!