C++ 的 EMACS开发 - CEDET 代码完成和项目存在问题
我正在 UBUNTU 上为 C++ 项目设置 EMACS。到目前为止,我成功安装了
- ECB
- CEDET - 我的代码完成和其他功能都正常工作。
- 颜色主题
我在使用 EDE 包时遇到问题。 “项目”菜单未显示。我已将 (global-ede-mode t) 添加到 .emacs 文件中,但没有成功。我需要单独安装EDE包还是CEDET附带的?我该如何解决这个问题并获得项目菜单?
我的第二个问题是语义无法找到系统包含文件。它说无法找到头文件,因此代码完成不适用于标准库。我已经添加了(require'semantic-gcc)但没有运气。我通过添加 (semantic-add-system-include "/usr/include/c++/4.3" 'c++-mode) 解决了这个问题,但我认为这不是正确的方法。我怎样才能让(require'semantic-gcc)起作用?
这是 .emacs 文件。
(load-file "~/emacs/cedet/common/cedet.el")
(load-file "~/emacs/cedet/ede/ede.el")
(semantic-load-enable-minimum-features)
(semantic-load-enable-code-helpers)
(semantic-load-enable-gaudy-code-helpers)
(semantic-load-enable-excessive-code-helpers)
(semantic-load-enable-semantic-debugging-helpers)
(require 'semantic-ia)
(require 'semantic-gcc)
(add-to-list 'load-path "/home/nkn/emacs/ecb-2.40")
(require 'ecb)
(require 'ecb-autoloads)
(setq ecb-tip-of-the-day nil)
(ecb-activate)
;; custom key bindings for smart completion
(global-set-key "\C-x\C-m" 'semantic-ia-complete-symbol-menu)
(load "/home/nkn/emacs/color-theme-6.6.0/color-theme.el")
(color-theme-initialize)
(setq color-theme-is-global t)
(color-theme-classic)
(require 'ede)
(setq global-ede-mode t)
(semantic-add-system-include "/usr/include/c++/4.3" 'c++-mode)
我已经检查了 Alex 的 关于该主题的文章,找不到与我的问题相关的任何信息。
任何帮助将不胜感激。
编辑
CEDET版本:cedet-1.0pre6
I am setting up EMACS for a C++ project on UBUNTU. I am successful so far in installing
- ECB
- CEDET - I got code completion and other features working.
- Color theme
I am having problems with EDE package. The "Project" menu is not showing. I have added (global-ede-mode t) to the .emacs file, but no luck. Do I need to install EDE package separately or it comes with CEDET? How can I solve this issue and have the project menu?
My second problem is with semantic unable to find system include files. It is saying unable to find the header file and so code completion doesn't work for standard library. I have added (require'semantic-gcc) but no luck. I got this solved by adding (semantic-add-system-include "/usr/include/c++/4.3" 'c++-mode) but I don't think this as the correct approach. How can I get (require'semantic-gcc) works?
Here is the .emacs file.
(load-file "~/emacs/cedet/common/cedet.el")
(load-file "~/emacs/cedet/ede/ede.el")
(semantic-load-enable-minimum-features)
(semantic-load-enable-code-helpers)
(semantic-load-enable-gaudy-code-helpers)
(semantic-load-enable-excessive-code-helpers)
(semantic-load-enable-semantic-debugging-helpers)
(require 'semantic-ia)
(require 'semantic-gcc)
(add-to-list 'load-path "/home/nkn/emacs/ecb-2.40")
(require 'ecb)
(require 'ecb-autoloads)
(setq ecb-tip-of-the-day nil)
(ecb-activate)
;; custom key bindings for smart completion
(global-set-key "\C-x\C-m" 'semantic-ia-complete-symbol-menu)
(load "/home/nkn/emacs/color-theme-6.6.0/color-theme.el")
(color-theme-initialize)
(setq color-theme-is-global t)
(color-theme-classic)
(require 'ede)
(setq global-ede-mode t)
(semantic-add-system-include "/usr/include/c++/4.3" 'c++-mode)
I have already checked Alex's article on the subject and couldn't find any information related to my problems.
Any help would be appreciated.
Edit
CEDET version : cedet-1.0pre6
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您使用的是哪个版本的 CEDET?
第二行配置不是必需的 - 第一行应该加载所有...
从第 3-7 行开始,您只需要留下一个,其中包含所需的功能集。在大多数情况下,您只需要使用第 4 行或第 5 行
EDE 应通过行 (global-ede-mode 1) 激活 - 至少,这对我有用。您可以查看 我的 cedet 配置
which version of CEDET are you using?
second line of config isn't necessary - first line should load all...
from lines 3-7 you need to leave only one, with needed set of features. for most cases you need to use only line 4 or 5
EDE should be activated by line (global-ede-mode 1) - at least, this works for me. You can look into my cedet config
仅当您位于项目中时,才会出现 EDE“项目”菜单。 EDE 可以自动检测项目,例如其中包含 Automake 文件的任何目录。它还会自动检测 Emacs 或 Linux 内核。
要从头开始创建新项目,请使用命令“ede-new”。然后您需要知道您想要创建什么类型的项目。以这种方式创建的项目将创建一个 Project.ede 文件,并且可以为您自动生成 Makefile。
为了让 gcc 自动检测支持正常工作,请尝试:
Mx语义-c-描述-环境
以查看它可能做了什么。您还可以使用:
Mx语义-gcc-setup
来强制它运行。如果您使用的是 gnu、gnu/linux、mac 或 cygwin 系统,它将自动执行此操作。
The EDE "Project" menu only appears if you are in a project. EDE can autodetect projects such as any directories with Automake files in it. It will also auto-detect Emacs, or the Linux kernel.
To create a new project from scratch, use the command `ede-new'. You would then need to know what kind of project you want created. Projects made this way will create a Project.ede file, and can autogenerate Makefiles for you.
For getting the gcc autodetect support working, try:
M-x semantic-c-describe-environment
to see what it might have done. You can also use:
M-x semantic-gcc-setup
to force it to run. It will automatically do so if you are on a gnu, gnu/linux, mac, or cygwin system.