Eclipse[HELIOS] CDT:自动完成,STL 不适用于 Eclipse ..帮助!
我是一个 java 用户,但想玩一下 CPP,所以我安装了 eclipse [HELIOS] 的 CDT 插件。
我在尝试正确配置它时遇到一些问题,想知道是否有人可以帮助我。这是我们可以使用的简短代码:
#include "Base.h"
// These lines give error => Unresolved inclusion: <vector>
#include <vector>
#include <string>
using namespace std;
void Base::ininitalizeVector()
{
for (int i = 0; i < 10; i++)
{
bIntVector.insert(i); //after pressing "." no method names etc appear
}
}
1] 自动完成功能不适用于 STL。 2] 在点击“点”后,我无法获取支持的方法等列表。 3]包含不起作用:#include 4] 我认为使用命名空间 std 足以让 STL 工作,但猜想对于 IDE 支持来说还不够?我什至需要说#include
我右键单击了项目 =>重建索引但这没有帮助 在我的项目中=> General=>源位置:源文件夹是包含此CPP文件和头文件的文件夹。
我可能没有正确配置,有什么帮助吗?
事实上,如果有其他可以快速开箱即用的 IDE,我会很乐意尝试一下。我想要的只是一些 IDE 支持,以便我可以在阅读 cpp 时验证内容。
谢谢
- 这是我得到CDT的地方: http://download.eclipse.org/tools/cdt/releases/helios/
- 我正在 Windows 上运行 eclipse 文件夹:C:\USER\setups\eclipse
I am a java user but wanted to play around with CPP so I installed CDT plugin for eclipse [HELIOS].
I am facing some issues trying to configure it correctly and am wondering if someone can help me. Here is a short code we can use:
#include "Base.h"
// These lines give error => Unresolved inclusion: <vector>
#include <vector>
#include <string>
using namespace std;
void Base::ininitalizeVector()
{
for (int i = 0; i < 10; i++)
{
bIntVector.insert(i); //after pressing "." no method names etc appear
}
}
1] The auto complete feature doesnt work for STLs .
2] I cant get a list of supported methods etc after I hit dot"."
3] Includes do not work: #include
4] I think using namespace std is enough for STLs to work , but guess not enough for IDE support ?. Do I even need to say #include
I did rightclick project => rebuild indexes but that didnt help
In my project=> general=>source location: the source folder is the folder that has this CPP file and the header file.
I probably havent configured things correctly , any help ?
Infact , if there is someother IDE which works quickly out of the box, I will be happy to try that out. All I want is some IDE support so that I can verify things while I read on cpp.
Thanks
- This is where I got the CDT:
http://download.eclipse.org/tools/cdt/releases/helios/ - I am running eclipse on Windows off a
folder: C:\USER\setups\eclipse
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
CODAN 中未解决的包含、链接到相关标头的类型没有自动完成功能,所有这些都意味着 Eclipse 无法在您在项目设置中告诉它的位置找到您请求的标头。在 Linux 上,STL 标头通常位于
/usr/include/c++/
中。然而,在 Windows 上,STL 头文件并未附带(也没有任何 GNU 工具),因此您可以通过安装 Cygwin。在 Visual Studio 中进行 Windows 开发总是更容易 - 毕竟它们是为彼此而设计的。
Unresolved inclusions in CODAN, no autocompletion for the types linked to the headers in question, all mean that Eclipse cannot find the headers you are requesting in the places you told it in the project settings. On Linux the STL headers are usually in
/usr/include/c++/<GCC Version>
. However on Windows the STL headers are not shipped with it (nor any GNU tools either), so you have 'fake' a Linux environment by installing Cygwin.Windows development is always easier in Visual Studio - they were designed for each other after all.