c++ - 如何在 emacs 中使用 gcc-code-assist?

标签 c++ gcc emacs g++ intellisense

我已经从源代码成功构建并安装了 gccsense 和 gcc-code-assist。
我已验证它们已正确安装。
但是,emacs 现在对 c 和 c++ 文件的行为方式没有变化(仍然没有智能感知!)

我该如何解决这个问题?

我用这些instructions正确构建和安装 gccsense 和 gcc-code-assist

PS:在阅读了更多有关该问题的信息后,我发现要测试一切是否已正确安装,我们必须运行命令 M-x gccsense-diagnose 并显示一条消息“Everything OK!”将出现在迷你缓冲区中。

我尝试了上述命令,但我在新缓冲区中收到以下错误消息,而不是消息“一切正常”:-

     Cannot obtain completions for std::string
     You may not use code-completion 

PPS:这是我的“.emacs”`文件:-

        (add-to-list 'load-path "~/.emacs.d/")  
(load "gccsense.el") 
(load "auto-complete.el") 

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(default ((t (:inherit nil :stipple nil :background "black" :foreground "gainsboro" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 128 :width normal :foundry "unknown" :family "Ubuntu Mono")))))
(defun switch-fullscreen nil
  (interactive)
  (let* ((modes '(nil fullboth fullwidth fullheight))
         (cm (cdr (assoc 'fullscreen (frame-parameters) ) ) )
         (next (cadr (member cm modes) ) ) )
    (modify-frame-parameters
     (selected-frame)
     (list (cons 'fullscreen next)))))

(define-key global-map [f11] 'switch-fullscreen)

 ; (global-auto-complete-mode t) 

最佳答案

你做到了吗? 将以下代码写入~/.emacs

(require 'gccsense)

关于c++ - 如何在 emacs 中使用 gcc-code-assist?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25017111/

相关文章:

c++ - c++中一对对象的映射比较器

C++ MinGW 链接器错误 _ZNSt7__cxx1112basic_stringlcSt11char_traitslcESalcEE10_M_replaceEjjPKcj

c - __attribute__ 是否适用于声明中的所有变量?

emacs - 设置语言环境和 M-x shell

c++ - 将 IP 与主机/网络地址列表进行比较

c++ - 可变函数的使用

c++ - 插入自定义类以映射为值时出错

c - arm-linux-androideabi-gcc 没有那个文件

emacs - emacs 中的 RDFa 代码应该使用哪种模式?

emacs - 如何禁用 Emacs 自动向右移动命令?