A vanilla company install wont quite get you where you want; you'll need to use use something like the company-c-headers
package. Tuhdo has written an excellent document on using Emacs as a C/C++ IDE, which has instructions on setting up company-c-headers
, along with a lot of other stuff.
I don't know what Emacs version you're using, but in 24.5 with Company, you'd do something like this:
- Install the
company-c-headers
package from MELPA -- M-x package-install company-c-headers
Add this to your emacs config file (init.el
/ .emacs.d
/ whathaveyou)
(require 'company)
(add-hook 'global-init-hook 'global-company-mode)
(add-to-list 'company-backends 'company-c-headers)
Note that company-c-headers
by default only searches two paths for headers. If you want it to search others, you'll need to add them yourself. (For more on that, see Tuhdo)
auto-complete
and/orcompany
.