ZachMassia / PlatformIO-Mode

PlatformIO Integration for Emacs
GNU General Public License v3.0
68 stars 20 forks source link

Compile and upload works but flycheck complains of Arduino.h not being found #5

Closed AoifeHughes closed 7 years ago

AoifeHughes commented 7 years ago

Not sure if this is a bug on my side with the setup but I have a flycheck error when using platformio-mode that states arduino.h cannot be found, but compile and upload still works.

ZachMassia commented 7 years ago

Hi @SirSharpest,

I quickly skimmed over your Emacs config. I think adding the following line might help:

(add-hook 'flycheck-mode-hook 'flycheck-irony-setup)

I remember running into similar errors regarding arduino.h when I was writing this, but can't quite remember the specifics.

Let me know how that works out for you.

ZachMassia commented 7 years ago

Awesome.

I'll update the readme to include flycheck-irony as a package requirement for using auto-complete.

fschuindt commented 1 year ago

I would like to re-open this, I'm quite lost here.

A section out of my init.el:

;; PlatformIO
(require 'platformio-mode)

;; This is a C/C++/Objective-C LSP.
(use-package ccls
  :ensure t
  :config
  (setq ccls-executable "ccls")
  (setq lsp-prefer-flymake nil)
  (setq-default flycheck-disabled-checkers '(c/c++-clang c/c++-cppcheck c/c++-gcc))
  :hook ((c-mode c++-mode objc-mode) .
         (lambda () (require 'ccls) (lsp))))

;; PlatformIO
;; Enable ccls for all c++ files, and platformio-mode only
;; when needed (platformio.ini present in project root).
(add-hook 'c++-mode-hook (lambda ()
                           (lsp-deferred)
                           (platformio-conditionally-enable)))

;; PlatformIO
(add-hook 'flycheck-mode-hook 'flycheck-irony-setup)

But it keeps saying 'Arduino.h' file not found [1]: image

@ZachMassia Any clue? Thanks!