I struggled to get it to work initially as well. I am not very good with Lisp myself.
First of all I think you will need an extra mode to make #include file works. I think you have company-irony-c-headers file.
Company-c-headers
Company-irony-c-headers
I think company-irony-c-headers should work better with company-irony. But I can't get it to work. I downloaded company-c-headers instead and it worked.
The key part is to configure these modes properly.
I will share my own configuration file here, which works for my Mac OS 10.9.
I stored all my configuration file under ~/.emacs.d/config/
For company, irony, company-irony and company-c-header modes, I configured all of them in a big .el file. You can just put it in your .emacs file which should work anyway.
Here is my file:
;; Define the modes/packages you need
(require 'company)
(require 'irony)
(require 'company-c-headers)
;; Enable company mode globally
(add-hook 'after-init-hook 'global-company-mode)
;; Here I define a function so it can be called anytime I want to load it
(defun irony-comp-setup-basic()
;; A function to add path to company-c-headers
(defun company-c-headers-includes ()
;; You just need to modified the path inside the quote to your header files path
(add-to-list 'company-c-headers-path-system "$ROOTSYS/include")
)
;; Now call this function so it add your path to company-c-header-path-system
(company-c-headers-includes)
;; Irony-mode configuration
(add-hook 'c++-mode-hook 'irony-mode)
(add-hook 'c-mode-hook 'irony-mode)
(add-hook 'objc-mode-hook 'irony-mode)
;; replace the `completion-at-point' and `complete-symbol' bindings in
;; irony-mode's buffers by irony-mode's function
(defun my-irony-mode-hook ()
(define-key irony-mode-map [remap completion-at-point]
'irony-completion-at-point-async)
(define-key irony-mode-map [remap complete-symbol]
'irony-completion-at-point-async))
(add-hook 'irony-mode-hook 'my-irony-mode-hook)
;; This customize some backends to the company-backends I took it from my friend's code
(custom-set-variables
'(company-backends (quote (company-irony company-elisp company-bbdb company-nxml company-css company-eclim company-semantic company-\
clang company-xcode company-ropemacs company-cmake company-capf (company-dabbrev-code company-gtags company-etags company-keywords) com\
pany-oddmuse company-files company-dabbrev))))
(custom-set-faces
)
;; This add your company-c-headers to company-backends
(add-to-list 'company-backends 'company-c-headers)
;; Default config for company-irony mode
(eval-after-load 'company
'(add-to-list
'company-backends 'company-irony))
;; For irony mode I think
(add-hook 'irony-mode-hook 'company-irony-setup-begin-commands)
)
;; Now call this function to active it
(irony-comp-setup-basic)
Let me know if it's working or not.