Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs, cedet and c++/c++11 support

I usually develop using emacs in a linux environment (ubuntu) because I love the editor. I've been also using eclipse from time to time but I find it slow.

Since I want IDE-like features, I tried to setup cedet and it seems to be sort of doing the work.

  1. I find that cedet never finds base class members. For example, std::vector in gcc has std::vector::size in its base class and it cannot find it.
  2. Seems inaccurate: If I do something like "myvector." it will give me completions like size_type.
  3. Cannot use auto from c++11, it seems not to work.
  4. srecode-getset gives me errors even for basic usage.

My configuration does not give any error and is based in alexott cedet config.

My questions are:

  1. The completion is that inaccurate still? (Think of "vector." giving things like "size_type".
  2. What is the status of cedet for c++/c++11? Should auto be working? I'm doing anything wrong?

I tried to use both bundled ubuntu version and last version from bzr repository. CEDET seems an extremely useful tool, but I wonder if it needs more work.

Thanks in advance.

like image 618
Germán Diago Avatar asked Nov 21 '13 09:11

Germán Diago


1 Answers

Instead of relying on CEDET for completion, you might want to consider an alternative completion provider in Emacs.

Auto-complete-clang and auto-complete-clang-async both work with clang to get completions and with the auto-complete package to display them. Company-clang is similar, but uses the company package to display completions.

There is another minor mode for C, C++, and ObjC called irony that uses clang to get completions and can use multiple front-ends to display completions. This might have the best documentation for getting it set up.

All of these are available on Marmalade for use with the package manager in Emacs 24.

like image 61
JFM Avatar answered Oct 19 '22 03:10

JFM