Is anyone developping with emacs and managed to get autocompletion and flycheck working?
I have some autocompletion with rtags, but I still get “ofMain.h not found” and this completly blocks flycheck from working… I think flycheck can’t find “ofMain.h”.
Anyone has any experience with this?
Have you managed to make it work with other packages? Any advice is welcome!
I had no problems at all and just used bear to collect building information. See rtags setup
rdm has to run in the background. See the Quick start of rtags
or run rdm as a user service:
On Ubuntu install bear with:
sudo apt-get install bear
Then in your OF project - you can of course use an example project for testing -
rc -J .
In Emacs just install the rtags package with MELPA.
Hope it helps. Please let me know. Maybe you could provide some background on your OS.
Thank you for your reply!
I’m using Fedora 26, but I had this problem on Archlinux as well when I was using it.
I followed the rtags settings to the letter (using bear), and it works fine with other projects, I just never made it work with OF…
But my knowledge of emacs is very limited, so I’m probably doing something wrong^^
Have you made flycheck work as well in openframeworks?
Yes. It was also very easy. Flycheck also uses the compile_commands.json file and does a fantastic job. Rtags and Flycheck are actually the only solutions I could get working with OF. The indexer in CDT/Eclipse fails and the parser in KDevelop is just too slow to be usable.
The instructions are easy^^
I’ve made rtags work before. Also company. Also flycheck.
Just never together!
I’ve started a new configuration from scratch using the instructions, I’ve attached it for reference. Could you share your setup as well? So we can compare and see what I’m doing wrong^^
For reference, using Emacs 25.3.1
rtags-emacs-config.zip (1.2 KB)
Rtags works fine, I’ve had some autocompletion. But it doesn’t seem to be getting everything (for instance in the main.cpp file it can’t auto complet ofSetupOpengl).
Flycheck works fine on its on and other modes, but just shows nothing when rtags is around.
good you are asking. I am actually using rtags only for referencing and irony for completion. Regarding flycheck I use the irony-flycheck Emacs package. My init.el is a bit oldish and won’t probably help you. I would have to clean it up first as there are also security related settings in there. But here are the relevant entries of init.el I am using (Emacs 25.1.1):
;; Irony mode
(add-hook 'c++-mode-hook 'irony-mode)
(add-hook 'c-mode-hook 'irony-mode)
(add-hook 'objc-mode-hook 'irony-mode)
(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
;; Irony Flycheck integration
'(add-hook 'flycheck-mode-hook #'flycheck-irony-setup))
Here might be some interesting blog posts for you:
Actually, I used the first link as basis to setup my own configuration.
BTW, I have clang version 4.0.0 installed on my box. This might be also important.
I got it to work thank you!
I think I waslugging them all together incorrectly. And I shouldn’t have overlooked Irony, it looks super powerful!
Here’s a configuration I’ve managed to make to work for people that might be having the same issue.
rtags-emacs-config.zip (1.8 KB)
Thank you for your time!
I hope I could keep up your spirits while you were struggling with the configurations.
Thanks for sharing your config files. I will change mine to use more use-package in the future.
Half the fun is struggling
Yeah use-package is great, makes things more tidy!
I’d love to see what your configuration will look like then
hey schmidh & shadowmitia,
thanks a lot, this discussion was really helpful!