C++/Eclipse CDT代码补全问题(Wascana,mingw)

标签 c++ eclipse mingw eclipse-cdt

我的 CDT 有问题。代码完成不适用于标准库类。 例如,在此代码中输入 x 后。并且按下 ctrl+space IDE 不显示 API 元素列表。

#include 
void f() {

 string x = "sss";
 x.
}

Includes 目录中提供了字符串和 vector 头文件。当我按下 ctrl 并单击包含行时,我被重定向到头文件。

代码补全似乎适用于 C std 库。

我的 eclipse 版本:

Eclipse IDE for C/C++ Developers
Version: Helios Release
Build id: 20100617-1415

Eclipse C/C++ Development Tools
Version: 7.0.0.201006141710
Build id: 201006141710

请帮忙。

最佳答案

试试这个:

#include <iostream>
#include <string>
using namespace std;

int main ()
{
  string str ("Test string");
  cout << "The size of str is " << str.size() << " characters.\n";
  return 0;
}

首先:检查它是否编译,然后将光标放在“return”之前并尝试代码辅助:“str”。看看它是否弹出。

关于C++/Eclipse CDT代码补全问题(Wascana,mingw),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3958807/

相关文章:

c++ - 编译器似乎拒绝成员之前的类标识符初始化

c++ - 未解析的 glGenVertexArrays 和 glBindVertexArray

c# - 调用从 C# 获取指针的 C++ 函数

c++ - 常量映射元素访问

Groovy 的 Java 项目无法编译

java - 如何从 Hibernate 配置工具修复 'Problems while reading database schema'

windows - Windows 生成文件中的反斜杠

c++ - C/C++ : Static function in header file, 是什么意思?

eclipse - SVN : E180001: Unable to open an ra_local session to URL

c++ - 基于范围的 for 循环从 1 而不是 0 开始?