C++ emacs cedit c++;代码完成失败

C++ emacs cedit c++;代码完成失败,c++,emacs,autocomplete,cedit,C++,Emacs,Autocomplete,Cedit,我是emacs的新手,我尝试使用cedit来完成代码。 我使用一个基于 .emacs看起来像这样: ;; cedit (semantic-mode 1) (require 'semantic/ia) (require 'semantic/bovine/gcc) ;;(require 'semantic/bovine/clang) ;;(semantic-clang-active) (setq-mode-local c-mode semanticdb-find-default-throttle

我是emacs的新手,我尝试使用cedit来完成代码。 我使用一个基于

.emacs看起来像这样:

;; cedit
(semantic-mode 1)
(require 'semantic/ia)
(require 'semantic/bovine/gcc)
;;(require 'semantic/bovine/clang)
;;(semantic-clang-active)

(setq-mode-local c-mode semanticdb-find-default-throttle
                 '(project unloaded system recursive))

;;(semantic-idle-summary-mode )
;; if you want to enable support for gnu global
(semanticdb-enable-gnu-global-databases 'c-mode)
(semanticdb-enable-gnu-global-databases 'c++-mode)
;;(semantic-reset-system-include 'c-mode)
;;(semantic-reset-system-include 'c++-mode)
(defun my-c-mode-cedet-hook ()
 (local-set-key "." 'semantic-complete-self-insert)
 (local-set-key ">" 'semantic-complete-self-insert))
(add-hook 'c-mode-common-hook 'my-c-mode-cedet-hook)
(add-hook 'c++-mode-common-hook 'my-c-mode-cedet-hook)

(defun my-c-mode-cedet-hook ()
  (add-to-list 'ac-sources 'ac-source-gtags)
  (add-to-list 'ac-sources 'ac-source-semantic)
  (add-to-list 'ac-sources 'ac-source-semantic-raw))
(add-hook 'c-mode-common-hook 'my-c-mode-cedet-hook)


(global-ede-mode t)
在我使用这个简单的c++文件进行测试之后:

#include <string>
#include <map>
#include <stdio.h>
#include <iostream>

using namespace std;

int main() {

  string s; 

  map<int,int>a;

}
#包括
#包括
#包括
#包括
使用名称空间std;
int main(){
字符串s;
mapa;
}
我发现它可以完成include或header file等关键字。当我尝试完成s的方法时,它失败了。当我使用命令
semantic ia complete symbol
它只是报告
找不到字符串s的类型

有人能告诉我为什么它不能工作吗?
非常感谢

只需更新到最新的Emacs即可。 在这里,您的示例使用zero配置,即

emacs -Q test.cc

M-x
语义模式
语义ia完整符号

我试过了,但不起作用。我正在使用emacs 24.3.1。如果我在这个文件中定义了一个类,并且它可以成功地完成这些方法。