So, I have used CEDET for awhile now, and things work pretty well in general. I'm moving from using it with C to C++, specifically for OpenCV 2.3 (linux) and I'm running into problems. I'm using emacs24 with the latest dev version of CEDET.
It is unable to parse some symbols and their members, like: KeyPoint, Mat,
etc.
Many of the function symbols ARE parsed however, such as line(), imshow(), imread()
, etc.
I'm looking for help on how to debug what's wrong with my setup, or someone who has successfully setup opencv c++ api.
Here is my relevant cedet config:
;; brian-cedet.el
;; Contains my personal configuration for CEDET
;; Loads for CEDET
(load-file "/home/terranpro/code/cedet/common/cedet.el")
(add-to-list 'Info-default-directory-list
(expand-file-name "~/code/cedet/common"))
(add-to-list 'Info-directory-list
(expand-file-name "~/code/cedet/common"))
(add-to-list 'Info-directory-list
(expand-file-name "~/code/cedet/semantic/doc"))
(add-to-list 'Info-directory-list
(expand-file-name "~/code/cedet/eieio"))
(add-to-list 'Info-directory-list
(expand-file-name "~/code/cedet/speedbar"))
(add-to-list 'Info-directory-list
(expand-file-name "~/code/cedet/cogre"))
(add-to-list 'Info-directory-list
(expand-file-name "~/code/cedet/ede"))
(add-to-list 'Info-directory-list
(expand-file-name "~/code/cedet/srecode"))
(require 'ede)
(global-ede-mode t)
;;(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)
(require 'semantic-sb)
(require 'semanticdb)
(global-semanticdb-minor-mode 1)
(require 'semanticdb-global)
(semanticdb-enable-gnu-global-databases 'c-mode)
(semanticdb-enable-gnu-global-databases 'c++-mode)
(require 'semantic-c)
(setq semantic-load-turn-useful-things-on t)
(semantic-add-system-include "/usr/include/glib-2.0" 'c-mode)
(semantic-add-system-include "/usr/include/glib-2.0" 'c++-mode)
(semantic-add-system-include "/usr/include/gtk-3.0" 'c-mode)
(semantic-add-system-include "/usr/include/gtk-3.0" 'c++-mode)
(semantic-add-system-include "/usr/local/include/" 'c-mode)
(semantic-add-system-include "/usr/local/include/" 'c++-mode)
(semantic-add-system-include "/usr/local/include/opencv" 'c-mode)
(semantic-add-system-include "/usr/local/include/opencv2" 'c++-mode)
(semantic-add-system-include "/usr/local/include/opencv" 'c-mode)
(semantic-add-system-include "/usr/local/include/opencv2" 'c++-mode)
(add-to-list 'semantic-lex-c-preprocessor-symbol-file
'"/usr/local/include/opencv2/core/types_c.h")
(add-to-list 'semantic-lex-c-preprocessor-symbol-file
'"/usr/local/include/opencv2/imgproc/types_c.h")
(add-to-list 'semantic-lex-c-preprocessor-symbol-map '("CV_PROP_RW" . ""))
(add-to-list 'semantic-lex-c-preprocessor-symbol-map '("CV_EXPORTS" . ""))
(add-to-list 'semantic-lex-c-preprocessor-symbol-map '("CV_EXPORTS_W_SIMPLE" . ""))
(defun my-cedet-hook ()
(local-set-key [(control return)] 'semantic-ia-complete-symbol)
(local-set-key "\C-c?" 'semantic-ia-complete-symbol-menu)
(local-set-key "\C-c>" 'semantic-complete-analyze-inline)
(local-set-key "\C-c=" 'semantic-decoration-include-visit)
(local-set-key "\C-cj" 'semantic-ia-fast-jump)
(local-set-key "\C-cq" 'semantic-ia-show-doc)
(local-set-key "\C-cs" 'semantic-ia-show-summary)
(local-set-key "\C-cp" 'semantic-analyze-proto-impl-toggle)
(local-set-key "\C-c+" 'semantic-tag-folding-show-block)
(local-set-key "\C-c-" 'semantic-tag-folding-fold-block)
(local-set-key "\C-c\C-c+" 'semantic-tag-folding-show-all)
(local-set-key "\C-c\C-c-" 'semantic-tag-folding-fold-all))
(add-hook 'c-mode-common-hook 'my-cedet-hook)
(add-hook 'emacs-lisp-mode-hook 'my-cedet-hook)
(add-hook 'lisp-interaction-mode-hook 'my-cedet-hook)
(global-semantic-tag-folding-mode 1)
I have a working configuration now; thanks to Alex Ott and David Engster from cedet-devel mailing list. To note their corrections, there were some lines in my configuration that were ' not needed and possibly hurtful.' After updating the config, deleting all files in ~/.semanticdb and restarting emacs, things are working as expected!
I've also included a sample cpp file for testing the configuration. Thanks guys!
And the CPP test file: