Vim: linter can't find the 'Arduino.h' file #808

lynndylanhurley opened this Issue Oct 16, 2016 · 4 comments


None yet

3 participants

lynndylanhurley commented Oct 16, 2016 edited


Operating system:

Mac OS X 10.11.6

PlatformIO Version (platformio --version):


Description of problem

Using Vim, the neomake linter plugin can't seem to find the Arduino libs. Here is the complete output of the error.

This is the command that is run:

clang++ -fsyntax-only -Wall -Wextra /Users/lynnhurley/Code/ChainedSignal

And this is the error:

clangtidy: 'Arduino.h' file not found [clang-diagnostic-error]

platformio run works just fine.

Steps to Reproduce

  1. platformio init --board megaatmega2560
  2. Paste blink code from the quickstart guide.
  3. Save src/main.cpp

Actual Results

The following error:

clangtidy: 'Arduino.h' file not found [clang-diagnostic-error]

Expected Results

There should be no linter errors.

If problems with PlatformIO Build System:

The content of platformio.ini:

platform = atmelavr
board = megaatmega2560
framework = arduino

Source file to reproduce issue:

 * Blink
 * Turns on an LED on for one second,
 * then off for one second, repeatedly.
#include "Arduino.h"

void setup()
  // initialize LED digital pin as an output.

void loop()
  // turn the LED on (HIGH is the voltage level)
  digitalWrite(LED_BUILTIN, HIGH);

  // wait for a second

  // turn the LED off by making the voltage LOW
  digitalWrite(LED_BUILTIN, LOW);

  // wait for a second

Additional info

I guess the main questions are:

  1. The neomake linter wants to use clang++ by default. Is this correct, or should neomake be using a different system for linting?
  2. If clang++ is the correct linter, what is the best way to tell clang++ where the platformio libraries are located?
  3. If clang++ is not the correct linter, what commands should neomake be running instead?

You see this error because didn't specify CPPPATH.

PlatformIO Build System has this data and other IDEs use it. For example, check pio run -t idedata. Does neomake allow to specify custom CPPPATH?


Oh nice, I didn't know about that command. I'll see what I can do with that, thanks @ivankravets!!


I'm sure you've already found a suitable answer, @lynndylanhurley, but for future readers, I've written a simple plugin for solving this problem in a general way.


@ivankravets ivankravets added this to the 3.2.0 milestone Dec 4, 2016
@ivankravets ivankravets added enhancement and removed help wanted labels Dec 4, 2016

@coddingtonbear thanks a lot for your plugin! I've just added it to PIO docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment